Quantcast
Channel: Adobe Community: Message List
Viewing all articles
Browse latest Browse all 121507

exportDataObject fails: "invalid action object"

$
0
0

Simple operation: I have a help file attached to the main PDF form.

All I want to do is open it once upon opening of the form.

I call the below function from the init procedure in the main form, but it fails.

What am I doing wrong ? The file name is "Test Help File.pdf".

 

 

function OpenAttachedHelpFile(pszFilename)

/* Open the attached help file unless it's already open */

{

  app.beginPriv();

  var oDoc;

 

  if ( !IsDocOpened(pszFilename) )

  {

    try

    { // now open the attachment in a temp folder

      oDoc = this.exportDataObject({cName: pszFilename, nLaunch: 2}); // always reference the parent document; 2=launch in system temp folder

 

    } catch ( e )

    {

      ShowError(e.message + "\c Path was \'" + szFilePath + "\'", 0);

    }

/*

    try

    {

      oDoc = app.openDoc({cPath: szFilePath, bHidden: false});

    }

    catch ( e )

    {

      app.alert('Error in app.openDoc: \'' + '\'' + szFilePath + e.message);

    }

*/

  }

 

  return oDoc;  // return a reference to the help file

  app.endPriv();

}

app.trustedFunction(OpenAttachedHelpFile);


Viewing all articles
Browse latest Browse all 121507

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>