Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems opening Word document from Access and doing search/replace!

Status
Not open for further replies.

jimtmelb1

Technical User
Sep 7, 2003
72
AU
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top