Replicating Insert Hyperlink-Bookmark function
I have been working on a solution to the issue of the Look in folder defaulting to the same folder regardless of the last selection. The solution I’ve come up with is a userform that replicates the functions of the built-in Insert Hyperlink dialog box (I’m calling it “Insert Hyperlink Plus”). Unlike the built-in, the useform, which is modeless, stays open after creating any number of links, and even allows one to set a directory folder as a default, so it can be easily accessed over different periods of time without having to navigate to it.
The problem I’m having is with the Bookmarks button, which in the built-in displays the headings (in the “Select Place in Document” popup) and, when one is selected, creates a link and a hidden bookmark. If there is more than one heading with the same text, Word recognizes that and creates an identical bookmark made unique by a numeric suffix. And it makes this bookmark at the destination area so it can navigate to it. So there must be a tie-in between the headings displayed in the popup and their location.
I’ve been trying to replicate this functionality through VBA to include in the “Insert Hyperlink Plus” function but without success. Is this possible to do with VBA?
|