Home › Forums › General XMetaL Discussion › Open document from browser with specific parameters › Reply To: Open document from browser with specific parameters
Reply to: Open document from browser with specific parametersMay 22, 2013 at 5:13 pm
XMetaL Author is also a COM server, so instead of “Excel.Application” substitute “XMetaL.Application” and then call appropriate APIs from there. Refer to the XMetaL Developer Programmers Guide for details on the various APIs available. There are several APIs for opening a file:
Application.Documents.Open() — opens a file in a way that is probably closest to what you are doing with Excel.
Application.Documents.OpenTemplate() — opens a file and treats it as a template.
Application.Documents.OpenString() — creates a new file based on a string you provide.
Keeping with your naming scheme you would probably call Open() like this:
var xmApp = new ActiveXObject(“XMetaL.Application”);
var xmDoc = xmApp.Documents.open(“c:\test\test.xml”);
In the case of XMetaL Author you do not need to worry about visibility as that is the default. If your script needs to known when XMetaL Author has finished starting up you can use the Application.InitComplete property.
If this will be an integration with a content management system (CMS) that will be used by more than one of our clients please consider creating a “connector” using the XMetaL Connector SDK (our partner manager can provide details). A connector is the preferred method for integrating with any CMS as it allows the software to function seamlessly with most document-level customizations.