View Single Post
 
Old 07-26-2021, 01:18 PM
asm1234 asm1234 is offline Windows 10 Office 2019
Novice
 
Join Date: Jul 2021
Posts: 3
asm1234 is on a distinguished road
Default Split Multiple Word Documents by Bookmark

Hello all,


I'm trying to split multiple Word documents into separate documents using the document bookmarks. I found a previously posted macro that works great for doing this. However, I'm running into an issue with the code as it relates to my project.



I'm trying to have the VBA loop across ~300 documents where all have the same bookmark names and are all in the same folder. It looks like the code loops across documents based on the "StrNm = Dir()" line. However, the newly saved folders are based on bookmark names, which are the same across all documents. It looks like this is causing an error and the marco to stop after the first document.



I want to adjust the code in two ways to (1) deal with the bookmark naming issue and (b) create new documents within the same folder (aka not create new folders for each new document. For example, the new documents should be roughly "[docname]_[bookmarkname].doc". How might I accomplish this?



Thanks in advance for any assistance someone can provide!
Reply With Quote