View Single Post
 
Old 06-24-2020, 02:13 PM
eduzs eduzs is offline Windows 10 Office 2019
Expert
 
Join Date: May 2017
Posts: 262
eduzs is on a distinguished road
Default

Is there a single sub that will do this for a list of words? Based on your code.

This code I was editing is not working:

Code:
Set oDoc = ActiveDocument
aFind = Array(". ,", "house")
Set oRng = oDoc.range
For x = 0 To UBound(aFind)
    With oRng.Find
        .Text = aFind(x)
        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
        Do While .Execute(Forward:=True) = True: oRng.HighlightColorIndex = wdYellow: Loop
    End With
Next x
__________________
Backup your original file before doing any modification.
Reply With Quote