Arbortext Command Language > Functions by Alphabetical Listing > com_attach
  
com_attach
handle = com_attach (progID)
Returns a handle to a COM object which can be used to invoke a method or access a property on that object. The object must be released when it is no longer needed using com_release.
The progID parameter is either the ProgID or the CLSID of the COM object to attach to. A ProgID is the name registered for the COM object, such as Excel.Application. A CLSID is a character string starting with { represents the GUID that uniquely defines the object to attach to. If the COM object is not running, it will be started either as a separate process or by loading a DLL into the Arbortext Editor process as appropriate. If the COM object doesn't exist or can't be invoked, the function returns a zero (0).
Example
wordh = com_attach("Word.Application")
The above code returns a handle that could be used to invoke Microsoft Word.
Related Topics
com_call function
com_prop_get function
com_prop_put function
com_release function