I'm trying to create a script in VBA for a Word document that bookmarks and hyperlinks matching strings with numbering to a location later in the document. Right now I have two sets of matching for matching text that looks like this (sometimes with hundreds of more entires):
Contents
'There is a bookmark here named "InpCon"
- 4326: Info 1
- 32534: Info 2
- 7980: Info 3
Body
'There is a bookmark here named "InpBod"
- 4326: Info 1
- 32534: Info 2
- 7980: Info 3
This is what I'm trying to do:
Table of Contents
'There is a bookmark here named "InpCon"
- 4326: Info 1 'Hyperlink to Bookmark Name: "Info1"
- 32534: Info 2 'Hyperlink to Bookmark Name: "Info2"
- 7980: Info 3 'Hyperlink to Bookmark Name: "Info3"
Body
'There is a bookmark here named "InpBod"
- 4326: Info 1 'Bookmark Name: "Info1"
- 32534: Info 2 'Bookmark Name: "Info2"
- 7980: Info 3 'Bookmark Name: "Info3"
I'm trying to implement this at the end of a larger script I have. The larger script copies everything under the "InpBod" bookmark to the "InpCon" bookmark at one point. I don't know if inputting a process there to do this would be more efficient.
Basically, my VBA knowledge is pretty limited. I've tried looking for something that accomplishes this task, but haven't found anything. I'd paste my code, but it's pretty large and on a stand alone system. This would shave hours off my week if I can get it done. Can someone help me out or point me in the right direction? Thanks you in advance.