These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Invoke an open dialog by pressing a button

StevenD
Registered: Oct 6 2006
Posts: 368
Answered

Someone here at work is asking if it is possible to click a button and get an open dialog appear so he can choose another PDF to open? I have been looking but I sure can't find anything. I know I can set an action to open a specific document. He would like to be able to let users choose the file to open.

StevenD

My Product Information:
Acrobat Pro 10.1, Macintosh
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1875
Accepted Answer
Try the app.execMenuItem method to trigger the File - Open menu item, but you will have to make a registry change to allow it to work, or use a trusted function in a folder-level JavaScript file, as explained in the documentation: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.143.php

The other option is to use the app.browseForDoc method. The documentation shows an example of what you're asking about, but you'd have to add the code to a trusted function in a folder-level JavaScript file, which shouldn't be a problem. See: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.138.php
StevenD
Registered: Oct 6 2006
Posts: 368
Thanks. A hassle but it works and I will see if this guy really wants to do this. Thanks for the great references. They were quite helpful.

StevenD