Continuing the Macro

S

Steved

Hello from Steved

I've written myself a macro that extracts information from
a paragraph. When it has finished the cursor is on the
next paragraph, question how do I get it to do it
automatically instead of restarting the macro at each
paragraph please. Sometimes I've 300 hundred Paragraphs
and it would be good to start the macro and do all the
paragraphs to the end.
Thankyou.
 
D

Doug Robbins

Dim i as Long, pararange as Range
For i =1 to ActiveDocument.Paragraphs.Count
Set pararange to ActiveDocument.Paragraphs(i).Range
'Run your code on pararange
Next i
--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
 
S

Steved

Excellent I thankyou.
-----Original Message-----
Dim i as Long, pararange as Range
For i =1 to ActiveDocument.Paragraphs.Count
Set pararange to ActiveDocument.Paragraphs(i).Range
'Run your code on pararange
Next i
--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
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