Hi,
I have this working code to replace Text in word documents:
(objDoc is an object word)
objDoc.Select
With Selection.Find
.Text = "Old text"
.Replacement.Text = "New text"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
This code works but I tried it in another Pc getting the error '5' in line: .Text = "Old text"
Both Pc's have W2K, Office 2K and the vba code is running in access 2K. Indeed, both pc's have a copy of the same mdb file to ensure that both the code and the references are the same.
I appreciate any clue about this.
Thx
I have this working code to replace Text in word documents:
(objDoc is an object word)
objDoc.Select
With Selection.Find
.Text = "Old text"
.Replacement.Text = "New text"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
This code works but I tried it in another Pc getting the error '5' in line: .Text = "Old text"
Both Pc's have W2K, Office 2K and the vba code is running in access 2K. Indeed, both pc's have a copy of the same mdb file to ensure that both the code and the references are the same.
I appreciate any clue about this.
Thx