Add Button to Open Default Document

www.altova.com Print this Topic Previous Page Up One Level Next page

Home >  ActiveX Integration > ActiveX Integration Examples > HTML > HTML Integration at Application Level >

Add Button to Open Default Document

As a simple example of how to automate some tasks, we add a button to the page:

 

<input type="button" value="Open Marketing Expenses" onclick="BtnOpenMEFile()">

When clicked, a predefined document will be opened in the MapForceControl. The MakeAbsolutePath method creates an absolute path using the location of the script as a base path.

 

function BtnOpenMEFile()
{
  var strPath = MakeAbsolutePath("MarketingExpenses.mfd");
  var objDoc = objMapForceControl.Open(strPath );
 
  if (objDoc == null)
     alert("Unable to locate MarketingExpenses.mfd at: " + objMapForceControl.BaseHref);
}


© 2019 Altova GmbH