Expand my Community achievements bar.

How to set button to Open a File

Avatar

Former Community Member
I have Adobe LiveCycle 8 & Acrobat 8 and looking for assistance in setting the button option to open a file in LiveCycle. Can someone please let me know how this can be done?
1 Reply

Avatar

Former Community Member
Hi,<br /><br />I don't really know what you mean by "open a file in LiveCycle" but here are a couple of options:<br /><br />1. To load a file into a pdf as an attachment, you can put<br /><br />> event.target.importDataObject("AttachmentName");<br /><br />on the click event of a button (make sure it's javascript).<br /><br />More information on this function is found on page 317 of the <a href="http://www.adobe.com/devnet/acrobat/pdfs/js_api_reference.pdf">JavaScript for Acrobat API Reference - v8.1</a><br /><br />2. Use app.launchURL(<filename>, newWindow);<br />(where newWindow is true or false)<br /><br />on the click event of a button.<br /><br />(Page 127 of the "JavaScript for Acrobat API Reference - v8.1" book)<br /><br />This will open a browser and attempt to launch the file reference by the filename. This is normally a webpage - <br /><br />> app.launchURL("http://www.adobe.com", 1);<br /><br />but could be a file on a local drive - <br /><br />> app.launchURL("c:/somefile.txt", 1);<br /><br />Good luck<br />Anthony Jereley<br /><a href="www.indigopacific.com">www.indigopacific.com</a><br /><br />Indigo Pacific