View Single Post
 
Old 02-26-2023, 12:31 PM
BrianHoard BrianHoard is offline Windows 10 Office 2019
Advanced Beginner
 
Join Date: Jul 2022
Location: Haymarket, VA USA
Posts: 85
BrianHoard is on a distinguished road
Default

Just a thought. What if you had the user enter a keyword where they wanted to start, and end. Then, let your script look for that to determine the range to work with? I know it may not be perfect, but I have used this sort of thing in the past as a quick way to get something done. For instance, if at the start of your desired range, the user entered some unique string like <<<FORMAT START HERE>>>, and a similar one at the end.
Some pseudo code to work with that might be...
Using a find, search for <<<FORMAT START HERE>>>.
Store the .Start of this range as a variable.

Do the same for <<<FORMAT END HERE>>>, getting the .End of that range.

Now, you have your .Start and .End stored so apply your formatting to that.
When finished, delete the formatting strings.

Just something to consider, as I am not sure there is a way to tell Word to act on pages, since the number pages can vary as you edit the document and things automatically flow from page to page.
Reply With Quote