03-17-2017, 03:12 PM
Quote:1.VBA:(Find replacement of define content)Macro Find and Replace 1
With Selection.Find
.ClearFormatting
.Text = "hi"
.Replacement.ClearFormatting
.Replacement.Text = "hello"
.Execute Replace:=wdReplaceAll, Forward:=True, _
Wrap:=wdFindContinue
End With
;/exe 1
typelib Word {00020905-0000-0000-C000-000000000046} 8.0
Word.Application app._getactive
app.Selection.Find.ClearFormatting()
app.Selection.Find.Text = "hi"
app.Selection.Find.Replacement.ClearFormatting()
app.Selection.Find.Replacement.Text = "hello"
VARIANT vForward=1
VARIANT vWrap=Word.wdFindContinue
VARIANT vReplaceAll=Word.wdReplaceAll
app.Selection.Find.Execute(@ @ @ @ @ @ vForward vWrap @ @ vReplaceAll)
app.ActiveDocument.Save