Search Highlight Text

A

Abhijeet Sheorey

Using word macro i want to find a specific( For Eg. wdRed
out of sixteen Highlight color ) highlight text in the
document.
 
S

Suzanne S. Barnhill

You can use the Find dialog to search for highlighted text, but I don't
believe you can specify a color. For that you would indeed need a macro; if
you don't get an answer here, try posting in one of the word.vba NGs.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://www.mvps.org/word
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
J

Jay Freedman

Sub FindNextRedHighlight()
Dim oRg As Range
Set oRg = ActiveDocument.Range
With oRg.Find
.ClearFormatting
.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = True
.Highlight = True
Do While .Execute
If oRg.HighlightColorIndex = wdRed Then
oRg.Select
Exit Sub
End If
Loop
End With
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top