lesterm
asked on
Looping in Word VBA to the End of Document
I need to know how to write a loop that will execute until it reaches the End of the Document. Something like the following: "Do while Not EOF". If that is not possible I would like to know how to at least count the lines in the document?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for the answer, but I was wanting to know how to count line by line or execute a command until the end of the file. However, I do like the subroutine that you sent me.
You can use the Word.wdWordDialog with the constant wdDialogToolsWordCount. This function will return your lines, paragraphs etc.