15 Replies Latest reply on Jun 14, 2017 12:33 PM by cyndi2966

    Using hyperlinks to non pdf files in a popup menu

    cyndi2966

      I am not educated at all in javascript so I need the expertise of someone here to help me please!!!

       

      I came across this page on the old Adobe Forum pages - https://acrobatusers.com/tutorials/popup-menus-part-i

       

      This sort of popup menu is exactly what I need.  But I need it to work so that when someone clicks on the choice it either opens a Word document or a webpage.  The Word doc would ideally be an attachment to the PDF.  But if that isn't possible then it could be located in the same folder as the PDF. 

       

      The code for the popup menu only works on PDF's saved in the same folder.  How do I make it work for Word doc's and URL's?

       

      The above link says:

       

      This menu is designed to open PDF documents within a common folder. Note that you’ll want your host document and supporting documents all copied to the same folder. To create a popup menu that opens other documents, add a Button field and then add a Run JavaScript action in the Actions tab. When you click the Add button in the Actions tab, enter the following Acrobat JavaScript code:

      var cChoice = app.popUpMenu( ["Human Resources", "eeoAnalysis.pdf", "employeeData.pdf"], ["Customer Forms", "customerID.pdf", "orderForm.pdf", "purchaseOrder.pdf", "corporateOrder.pdf"], ["Employee Forms", "employeeApplication.pdf", "performanceEvaluation.pdf", ] ); app.openDoc((cChoice), this); 

      Each line within the brackets is a different root menu item. The text appearing within the first quotations marks is a menu title and the remaining text within each set of quotes defines the filenames I want to open when accessing the submenu command. The last line of code instructs Acrobat to open the file selected from a selected menu command.