Quote:
Originally Posted by Stephen Ray
I wrote this for myself to process a bulk of documents, assembled into one document, that were all similar except for a many variables like names and states; and where each document had to be re-arranged according to a certain formula. I needed some way to tell it to stop, end of document.
|
There are many code examples in this forum showing how to loop through paragraphs (if necessary) correctly. See, for example:
https://www.msofficeforums.com/123696-post2.html
https://www.msofficeforums.com/89357-post2.html
https://www.msofficeforums.com/word-...ge-header.html
https://www.msofficeforums.com/word-...nt-length.html
https://www.msofficeforums.com/139350-post2.html
https://www.msofficeforums.com/word-...ngle-line.html
None of these needs to select anything to do the required work and none needs an arbitrary counter to exit when done.
Content re-arrangement can often be done without the burden of looping through all paragraphs, though, via Find/Replace.