Family Tree
Dillahunty Family
Darla Baerg
Ideah Agency
I Get To!!
Craft a Craft
Peachbush Enterprises
Peachbush Gallery
Search and Replace in Windows Macro (vba)
This worked for me:
With Selection.Find^M
Selection.Find.ClearFormatting^M
Selection.Find.Replacement.ClearFormatting^M
^M
.Text = "<^#;"^M
.Replacement.Text = "<" & Counter & ";"^M
.Forward = True^M
.Wrap = wdFindStop^M
.Format = False^M
.MatchCase = False^M
.MatchWholeWord = False^M
.MatchWildcards = False^M
.MatchSoundsLike = False^M
.MatchAllWordForms = False^M
End With^M
^M
' Execute the change - can be wdReplaceAll to do a global search and replace^M
Selection.Find.Execute Replace:=wdReplaceOne^M
^M
' Move after the selection^M
Selection.MoveRight Unit:=wdCharacter, Count:=1^
- bdillahu's blog
- Login or register to post comments