2 Replies Latest reply on Oct 19, 2010 8:04 PM by Boble5

    [VB CS5] Adding buttons with page hyperlinks (hyperlinkpagedestinations)


      Hi people.


      I'm trying to add buttons with a script that link to pages.


      I have got this far but the documentation is sparse and i can't find a solution.


      My code so far



      Set myInDesign = CreateObject("InDesign.Application")
      Set myDocument = myInDesign.Documents.Item(1)
      Set myPage = myDocument.Pages.Item(1)

      REM====Adding the button

      Set but = myDocument.Pages.Item(1).Buttons.Add
      but.GeometricBounds = Array(0,0,25,25)

      REM==== Adding the hyperlink

      set my_hyperlink = myDocument.hyperlinkPageDestinations.add(myDocument.Pages.Item(232))


      Creates the button ok, seems to create the hyperlink ok. That hyperlink should go to page 232.


      How do you add the hyperlink to the button so the button goes to page 232 when clicked?