How to make it search from the beginning of the document?

C

cyberdude

Hi,

Somebody gave me the following code to search words in red in a
document:

With Selection.Find
.ClearFormatting
.Forward = True
.Wrap = wdFindStop
.Format = True
.Font.Color = wdColorRed
End With

While Selection.Find.Execute
MsgBox (Selection.Text)
Wend

May I know how to force it to seach from the beginning of a document?
Thanks.

Mike
 
D

Doug Robbins - Word MVP

Put Selection.HomeKey wdStory before the first line of code.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

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