GetObject()
GetObject() opens an existing document or creates a new object handle to an Automation server application. Like many aspects of ActiveX, exactly how this is implemented and the necessary parameters for successful execution vary by application.
Usage |
oObject = GetObject( cObjectReference [, cClassName ] ) |
Parameter |
Value |
Meaning |
cObjectReference |
Character, Filename |
Name of an existing file, or (depending on the application) a blank or null value. |
Character, Moniker |
The identifier of an IMoniker interface of a COM object. |
|
Omitted |
Return a handle to an existing application, for some Automation servers. |
|
cClassName |
Character |
Name of a registered server class (you can look them up in the Registry). |
Example |
* Open the MySheet spreadsheet in Excel and get * a handle to the application. oExcel1 = GetObject("MySheet.XLS") * Talk to the running Word application. oWord = GetObject(, "Word.Application") |
See Also |