Start at top, run loop to end, then *STOP*!?

E

Ed

I am having the *hardest* time trying to get a loop of instructions to start
at the top of the document and stop at the end! I've tried several
different methods (End Of Doc bookmark, DO While Execute = True, and
others), and I keep getting endless loops of one kind or another.
Basically, the loop executes a Find, then inserts a page break and some
paragraph breaks at the Found. The loop works great, but I can't get it to
stop once it's found the last one in the document. Ccan anyone help?

Ed
 
D

Doug Robbins - Word MVP

Hi Ed,

You probably need a Wrap:=wdFindStop in the Do While .Execute(FindText
.......) = True command

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
E

Ed

Thanks, Doug! I had the Wrap=Stop, but I forgot to specify my text string
at the .Execute, so it just kept executing! Now it stops.

Also, this was a problem I ran into while trying a work-around for the
97-to-XP macro problem I posted earlier. If there is no clear-cut or known
reason why macros that ran on 97 won't go on XP, then never mind the earlier
post - it'll be easier just to write new macros.

Ed
 

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