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);