Hi,
I have an Access 2000 database. I am opening a doc in Word from Access and doing a search and replace of data from my database. This has always worked successfully.
Although, I have never been able to search and replace in a footer of a word document.
So I incorprated the code down below to help me acheive this. My code for searching and replacing outside header and footers is slightly different but has always worked successfully. I have added the code below to my function when it searches for fields in my footers only.
When I send the doc to Word the first time it does the replace successfully. When I try a second time I get the following error message;
"the remote server machine does not exist or is unavailable." Error 462.
Can someone please help me with this error. I can't show all the code this function is too big. Hope what I have included can help
Thanks
Jim
docWord.ActiveWindow.ActivePane.View.SeekView = wdSeekFirstPageFooter
'wdSeekCurrentPageFooter
With Selection.Find
.text = DBFieldsOut("Search Replace")
.Replacement.text = DBStaticValues(DBFieldsOut("Export Real Field Name"))
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
I have an Access 2000 database. I am opening a doc in Word from Access and doing a search and replace of data from my database. This has always worked successfully.
Although, I have never been able to search and replace in a footer of a word document.
So I incorprated the code down below to help me acheive this. My code for searching and replacing outside header and footers is slightly different but has always worked successfully. I have added the code below to my function when it searches for fields in my footers only.
When I send the doc to Word the first time it does the replace successfully. When I try a second time I get the following error message;
"the remote server machine does not exist or is unavailable." Error 462.
Can someone please help me with this error. I can't show all the code this function is too big. Hope what I have included can help
Thanks
Jim
docWord.ActiveWindow.ActivePane.View.SeekView = wdSeekFirstPageFooter
'wdSeekCurrentPageFooter
With Selection.Find
.text = DBFieldsOut("Search Replace")
.Replacement.text = DBStaticValues(DBFieldsOut("Export Real Field Name"))
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll