When do I get to the end ?

R

Robin Clay

Greetings !

I've done a fair bit of VBA in Excel, but VBA in Word seems a whole new
ball-game !

Here's a snippet:-
------------------------
N=1
Here = *****

Do
N=N+1
GeneralProcess
Loop Until N=Here
---------------------------------

What expression should replace the ***** so that the loop continues from the
top of the document to the end, i.e. "Here" is the line number (?) of the
start of the last paragraph ?

Pretty please ?


Robin
 
T

Tony Jollans

Working with Lines can be difficult as they are a fuzzy kind of concept in
Word. If you want to work with paragraphs (which your post suggsests) then
you could use...

For Each para in ActiveDocument.Paragraphs
' Do your stuff with the paragraph
Next
 
R

Robin Clay

Tony Jollans said:
For Each para in ActiveDocument.Paragraphs
' Do your stuff with the paragraph
Next

That seems as if it might do the trick - Thank you !


Robin
 

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