View Single Post
 
Old 09-10-2022, 08:43 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

Sounds to me like you may simply be entering your code in the wrong place. Hard to tell by your question. But I just did a quick test with your code and it worked on a small 2 page document, so it may work for you.
To use your script, try these steps...
  1. Open a copy of your 900 page document (working with a backup in case something goes wrong.)
  2. As an initial test, I'd delete 880 pages, so you have something easy to work with as you test this out.
  3. Press Alt F11 to open the Visual Basic editor.
  4. Right-click on your document in the Project area (screen shot attached), and select Insert Module
  5. Double-click on the module and paste in your code in the VBA code area.
  6. If all looks good, no red text, press F5 or press the play button to run your code.
If you get an error or anything doesn't work, please post the exact error you receive.
Attached Images
File Type: png wordSnap.png (219.8 KB, 14 views)
Reply With Quote