DaveTaylor
Programmer
I am trying to do a search & replace from access using automation. The following code works in the main body of a document but will not update the page header:
Dim varReplaceWith As Variant
varReplaceWith = Eval(myrs![fldbatch])
varReplaceWith = IIf(IsNull(varReplaceWith), " ", _
CStr(varReplaceWith))
With docword.Content.Find
With .Replacement
.ClearFormatting
.Font.Bold = True
.Font.Italic = True
.Font.Size = 16
End With
.Execute findtext:="BATCH", _
replacewith:=varReplaceWith, Format:=True, _
Replace:=wdReplaceAll
End With
Any help would be greatly appreciated.
Dim varReplaceWith As Variant
varReplaceWith = Eval(myrs![fldbatch])
varReplaceWith = IIf(IsNull(varReplaceWith), " ", _
CStr(varReplaceWith))
With docword.Content.Find
With .Replacement
.ClearFormatting
.Font.Bold = True
.Font.Italic = True
.Font.Size = 16
End With
.Execute findtext:="BATCH", _
replacewith:=varReplaceWith, Format:=True, _
Replace:=wdReplaceAll
End With
Any help would be greatly appreciated.