Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Highlight all instances of a word in MS-Word
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01328241
Message ID:
01328263
Views:
6
>There is, at least in Word 2007. Here a macro I just recorded:
>
>  Selection.Find.ClearFormatting
>  Selection.Find.Replacement.ClearFormatting
>
>  Selection.Find.Replacement.Highlight = True ' THIS!!!!!!
>
>    With Selection.Find
>        .Text = "king"
>        .Replacement.Text = "king"
>        .Forward = True
>        .Wrap = wdFindContinue
>        .Format = True
>        .MatchCase = False
>        .MatchWholeWord = True
>        .MatchWildcards = False
>        .MatchSoundsLike = False
>        .MatchAllWordForms = False
>    End With
>    Selection.Find.Execute Replace:=wdReplaceAll
>
Worked great in Word 2003.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform