Application Property

Microsoft Outlook Visual Basic

Application Property

       

Returns an Application object that represents the parent application (Microsoft Outlook) for an object.

expression.Application

expression   Required. An expression that returns an Outlook object.

Example

This Visual Basic for Applications example uses the Application property to access Outlook and then creates a new MailItem and displays it.

Set myOlApp = CreateObject("Outlook.Application")
Set myItem = myOlApp.CreateItem(olMailItem)
myItem.Display

If you use VBScript, you do not use the Application property to retrieve the Application object. Instead, you reference the Application object directly. This example shows how to perform the same task using VBScript.

Set myItem = Application.CreateItem(0)
myItem.Display