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

Re: How to make it search from the beginning of the document? by Doug

Doug
Thu May 08 20:45:59 PDT 2008

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

"cyberdude" <honchorlee@gmail.com> wrote in message
news:cf4c33c5-bf25-48c0-af13-ecc6cf88d2e7@f24g2000prh.googlegroups.com...
> 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