find highlighted text (word 2007)

A

abc

hi all

is there a way to find highlighted text in word 2007?

Example: I have a 1,000 pages document where I highlighted text in
different colors. Now I want to sequentially find all text that I
highlighted with yellow (not with other colors). How can I do that?

thanks
 
T

Terry Farrell

You can certainly find highlighted text through the normal Find command, but
I don't see a way to find only Yellow - though some of the Gurus may know a
way to do it with code.
 
G

Graham Mayor

You'll need a macro e.g.

Sub FindYellowHiLite()
Dim orng As Range
With Selection.Find
.Highlight = True
While .Execute
Set orng = Selection.Range
If orng.HighlightColorIndex = wdYellow Then
orng.Select
Exit Sub
End If
Wend
End With
End Sub

If you start with the cursor at the beginning it will select the next yellow
highlight each time the macro is run.When it runs out of yellow highlights
it will stop at the next highlight of whatever colour and go no further.
http://www.gmayor.com/installing_macro.htm


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
A

abc

Graham said:
You'll need a macro e.g.

Sub FindYellowHiLite()
Dim orng As Range
With Selection.Find
.Highlight = True
While .Execute
Set orng = Selection.Range
If orng.HighlightColorIndex = wdYellow Then
orng.Select
Exit Sub
End If
Wend
End With
End Sub

If you start with the cursor at the beginning it will select the next yellow
highlight each time the macro is run.When it runs out of yellow highlights
it will stop at the next highlight of whatever colour and go no further.
http://www.gmayor.com/installing_macro.htm

Thanks!
 

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