Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Want to open attached .xml file with Excel instead of default program

Avatar

Level 2

I want to attach an xml file (with the extension .xml) to my interactive PDF and have the user click a button to open the file with excel. I am using LiveCycle Designer ES 8.2.

I am able to get the file to open with the default program, but anticipate that some users will not have excel as the default program for xml files. (For example some users have it defaulted to Dreamweaver, others to IE.)

I found this script, and it works to open the file, but does not give the option to choose which program to use:

     form1.sf_Page_1.sf_DocHeader.Button1[1]::click - (JavaScript, client)

// Open the attached XML file

try {

    var myDoc = event.target;

    var sFile = "Import Formc.xml";

    myDoc.exportDataObject({ cName: sFile, nLaunch: 1 });

}

catch(e) {

    app.alert("There are no files to open!");

}

Is there any type of "Open with" option with this method? Any help is appreciated.

1 Reply

Avatar

Level 10

Hi,

the exportDataObject method has no argument to specify the application which will be launched.

So this action will always launch the default application associated to the given file extension.