pdering
asked on
Using Access VBA to Find/Replace text in a Word doc
Access 2013
Excel 2010
I'm trying to find/replace text in a word doc from access vba. The following code works except when "[A]" is inside a textbox in the word file. What am I missing?
Const wdReplaceAll = 2
Set objapp = CreateObject("Word.Applica tion")
objapp.Visible = True
objapp.Activate 'Bring to front
Set w = objapp.Documents.Open("Tem plate.docx ", ReadOnly:=True)
Set s = objapp.Selection
s.Find.Text = "[A]"
s.Find.Replacement.Text = "123"
s.Find.Execute , , , , , , , , , , wdReplaceAll
Excel 2010
I'm trying to find/replace text in a word doc from access vba. The following code works except when "[A]" is inside a textbox in the word file. What am I missing?
Const wdReplaceAll = 2
Set objapp = CreateObject("Word.Applica
objapp.Visible = True
objapp.Activate 'Bring to front
Set w = objapp.Documents.Open("Tem
Set s = objapp.Selection
s.Find.Text = "[A]"
s.Find.Replacement.Text = "123"
s.Find.Execute , , , , , , , , , , wdReplaceAll
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER