Whatever message this page gives is out now! Go check it out!

CreateObject: COM object

Last update:
May 18, 2026
Note:
As of ColdFusion (2021 release), CORBA has been removed. You can no longer use CORBA-related features, functions, and tags.

Description

The CreateObject function can create a Component Object Model (COM) object. To create a COM object, provide the following information:
  • The object's program ID or filename
  • The methods and properties available to the object through the IDispatch interface
  • The arguments and return types of the object's methods For most objects, you can get this information from the OLEView utility.
    On UNIX, this function does not support COM objects.

Returns

A COM object.

Function syntax

CreateObject(type, class, context, serverName)

See also

Parameters

ParameterDescription
type
Type of object to create.
  • com
  • corba
  • java
  • component
  • webservice The default value of type is component.
class
Component ProgID for the object to invoke.
context
  • InProc
  • Local
  • Remote
serverName
Server name, using UNC or DNS convention, in one of these forms:
  • lanserver
  • lanserver
  • http://www.servername.com
  • www.servername.com
  • 127.0.0.1 If context = "remote", this parameter is required.

Usage

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");

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page