Sandhya: You did not specify the removal of only green highlights - you said:
Quote:
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
|
which means all highlights.
And do you really suppose we need all of your last five posts to tell us basically the same thing? Try:
Code:
Sub Demo()
Application.ScreenUpdating = False
Dim i As Long
With ActiveDocument.Range
With .Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = True
.Highlight = True
.Execute
End With
Do While .Find.Found
If .HighlightColorIndex = wdBrightGreen Then
i = i + 1
.HighlightColorIndex = wdNoHighlight
End If
.Collapse wdCollapseEnd
.Find.Execute
Loop
End With
Application.ScreenUpdating = True
MsgBox i & " highlights found & removed."
End Sub