The CreateObject function can create a Component Object Model (COM) object.
To create a COM object, you must provide this information:
For most objects, you can get this information from the OLEView utility.
A COM object.
CreateObject(type,class,context,serverName)
ReleaseComObject, cfobject; "Integrating COM and CORBA Objects in CFML Applications" in the ColdFusion Developer's Guide
|
Parameter |
Description |
|---|---|
| type |
Type of object to create.
|
| class |
Component ProgID for the object to invoke. |
| context |
|
| serverName |
Server name, using UNC or DNS convention, in one of these forms:
If context = "remote", this parameter is required. |
The following example creates the Windows Collaborative Data Objects (CDO) for NTS NewMail object to send mail. You use this code in a cfscript tag.
Mailer = CreateObject("COM", "CDONTS.NewMail");