Documents are made up of various story ranges. If you want to process just the main document body then add
after
hiliRng.HighlightColorIndex = wdNoHighlight
otherwise
Sub SearchAnyHighlight()
Dim hiliRng As Range
Dim bFound As Boolean
For Each hiliRng In ActiveDocument.StoryRanges
With hiliRng.Find
.Highlight = True
.Execute
If hiliRng.Find.Found Then
If Not bFound Then
MsgBox "You can't close Active Document"
End If
bFound = True
End If
End With
Do While hiliRng.Find.Execute
If hiliRng.HighlightColorIndex = wdBrightGreen Then
hiliRng.HighlightColorIndex = wdNoHighlight
hiliRng.Collapse 0
End If
Loop
If hiliRng.StoryType <> wdMainTextStory Then
While Not (hiliRng.NextStoryRange Is Nothing)
Set hiliRng = hiliRng.NextStoryRange
Do While hiliRng.Find.Execute
If hiliRng.HighlightColorIndex = wdBrightGreen Then
hiliRng.HighlightColorIndex = wdNoHighlight
hiliRng.Collapse 0
End If
Loop
Wend
End If
Next hiliRng
Set hiliRng = Nothing
End Sub