View Single Post
 
Old 07-06-2016, 11:33 PM
DougMVP DougMVP is offline Windows 7 32bit Office 2010 32bit
Advanced Beginner
 
Join Date: Nov 2013
Posts: 50
DougMVP will become famous soon enough
Default

Use

Code:
 
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
    Do While .Execute(FindText:="\(insert * emoji\)", MatchWildcards:=True, Forward:=True, Wrap:=wdFindStop) = True
        With Selection
            If MsgBox("Click OK to colorize selection", vbOKCancel) = vbOK Then
                .Range.Shading.BackgroundPatternColor = wdColorYellow
            End If
            .Collapse wdCollapseEnd
        End With
    Loop
End With
If you just want the colorizing to happen without click OK each time, delete the If and EndIf lines, leaving the .Range.Shading.BackgroundPatternColor = wdColorYellow line.
Reply With Quote