_Application.CreateObject Method
Creates an Automation object of the specified class.
Namespace: Microsoft.Office.Interop.Outlook
Assembly: Microsoft.Office.Interop.Outlook (in Microsoft.Office.Interop.Outlook.dll)
Syntax
'Declaration
<DispIdAttribute()> _
Function CreateObject ( _
ObjectName As String _
) As Object
'Usage
Dim instance As _Application
Dim ObjectName As String
Dim returnValue As Object
returnValue = instance.CreateObject(ObjectName)
[DispIdAttribute()]
Object CreateObject(
string ObjectName
)
Parameters
ObjectName
Type: System.StringThe class name of the object to create. For information about valid class names, see OLE Programmatic Identifiers.
Return Value
Type: System.Object
An Object value that represents the new Automation object instance. If the application is already running, CreateObject will create a new instance.
Remarks
This method is provided so that other applications can be automated from Microsoft Visual Basic Scripting Edition (VBScript) 1.0, which did not include a CreateObject method. CreateObject has been included in VBScript version 2.0 and later. This method should not be used to automate Microsoft Outlook from VBScript.
Note
The CreateObject methods commonly used in the example code within this Help file (available when you click "Example") are made available by Microsoft Visual Basic or Microsoft Visual Basic for Applications (VBA). These examples do not use the same CreateObject method that is implemented as part of the object model in Outlook.