View Single Post
 
Old 11-28-2014, 07:08 AM
Sandhya Sandhya is offline Windows 7 32bit Office 2007
Novice
 
Join Date: Nov 2014
Posts: 21
Sandhya is on a distinguished road
Talking remove highlight in whole document

Hi,

Can any one help me to modify the code, this will remove the highlighted text at only one place, but i would like to remove in the whole active document.

Sub SearchAnyHighlight()
Dim hiliRng As Range
Set hiliRng = ActiveDocument.Content
With hiliRng.Find
.Highlight = True
.Execute
If hiliRng.Find.Found Then
MsgBox "You can't close Active Document"
Do While hiliRng.Find.Execute
If hiliRng.HighlightColorIndex = wdBrightGreen Then
hiliRng.HighlightColorIndex = wdNoHighlight
End If
Loop
End If
End With
End Sub
Reply With Quote