Access9001
Registered User.
- Local time
- Today, 03:37
- Joined
- Feb 18, 2010
- Messages
- 268
I am trying to add bookmarks dynamically in VBA to a pdf file. Here is the relevant code:
For Each element In OfficeArray
AVYourDoc.FindText element, True, True, True
AcroApp.MenuItemExecute ("NewBookmark")
PDBookmarker.GetByTitle PDYourDoc, "Untitled"
PDBookmarker.SetTitle (element)
Msgbox element
Next element
The problem is that it works right with the msgbox (but I have to click through them all). But without the msgbox, it'll add the first bookmark and then just keep adding the second one over and over again (although the bookmarks go to the right places, they're named incorrectly). What might be the reason?
For Each element In OfficeArray
AVYourDoc.FindText element, True, True, True
AcroApp.MenuItemExecute ("NewBookmark")
PDBookmarker.GetByTitle PDYourDoc, "Untitled"
PDBookmarker.SetTitle (element)
Msgbox element
Next element
The problem is that it works right with the msgbox (but I have to click through them all). But without the msgbox, it'll add the first bookmark and then just keep adding the second one over and over again (although the bookmarks go to the right places, they're named incorrectly). What might be the reason?