Retrieves a registered COM object.
ComObj := ComObjActive(CLSID)
Type: String
CLSID or human-readable Prog ID of the COM object to retrieve.
Type: ComObject
This function returns a new COM wrapper object with the variant type VT_DISPATCH (9).
An exception is thrown on failure.
ComValue, ComObject, ComObjGet, ComObjConnect, ComObjFlags, ObjAddRef/ObjRelease, ComObjQuery, GetActiveObject (Microsoft Docs)
Displays the active document in Microsoft Word, if it is running. For details about the COM object and its properties used below, see Word.Application object (Microsoft Docs).
word := ComObjActive("Word.Application") if !word MsgBox "Word isn't open." else MsgBox word.ActiveDocument.FullName