WScript.CreateObject() (Method)

Creates an instance of an automation object.

Availability:

JScript - 3.0
Property/method value type:WScript object
JavaScript syntax:WSHmyObject = WScript.CreateObject(aProgID);
WSHmyObject = WScript.CreateObject(aProgID, aPrefix);
Argument list:aProgIDAn application programme ID
aPrefixA hook into the event model

Calling this method yields an object which can be used to communicate with another application residing in the same computer.

For example, this code creates an object that references the Word application:

   myWord = WScript.CreateObject("Word.Application");

From here we can reference the application via the object. This makes the Word application we just instantiated visible to the user:

   myWord.Visible = true;