Skip to main content
April 5, 2017
Answered

createChild action doesnt not work in browser

  • April 5, 2017
  • 2 replies
  • 691 views

bkmChildsParent.createChild currentDepartment, "this.pageNum=" & dPageNum, dCount

This code creates a bookmark with the associated javascript action. I didn't realize that these javascript actions don't seem to be working when the PDF is opened in a browser. Is there a way to get the browser to work with a javascript action, or is there a way to add a non javascript action to these bookmarks within vba?

This topic has been closed for replies.
Correct answer

I ended up having to create bookmarks via menu actions. If u are able to stick with javascript actions then createChild will work. If not use the code below to create your bookmarks.

gApp.MenuItemExecute ("NewBookmark")

newTitle = newBookmark.GetByTitle(PDDoc, "Untitled")

newTitle = newBookmark.SetTitle("Title")

2 replies

Correct answer
April 7, 2017

I ended up having to create bookmarks via menu actions. If u are able to stick with javascript actions then createChild will work. If not use the code below to create your bookmarks.

gApp.MenuItemExecute ("NewBookmark")

newTitle = newBookmark.GetByTitle(PDDoc, "Untitled")

newTitle = newBookmark.SetTitle("Title")

Legend
April 5, 2017

What browser?

lrosenth
Adobe Employee
Adobe Employee
April 5, 2017

And does it have the Acrobat plugin inside or is it using some 3rd party PDF viewer?

April 7, 2017

I tested in both Firefox and Chrome. As you pointed out it was the built in viewers of these two browsers that was opening the pdf. Since the pdf I am generated will be public and I can't control what viewer they use is there a way to get these bookmarks to work within the 3rd party viewers. I know that when I create bookmarks manually (CTRL+B) from within Acrobat it works, but not using the javascript action from vba.