共用方式為


Application Property

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

expression**.Application**

*expression   * Required. An expression that returns an Outlook object.

Example

This Visual Basic for Applications (VBA) example uses the Application property to access Outlook and then creates a new MailItem and displays the version of Outlook used to create the item.

Sub CreateMailItem()
    Dim myolApp As Outlook.Application
    Dim myItem As Outlook.MailItem
    Set myolApp = CreateObject("Outlook.Application")
    Set myItem = myolApp.CreateItem(olMailItem)
    MsgBox myItem.Application.Version
End Sub

If you use Microsoft Visual Basic Scripting Edition (VBScript) in a Microsoft Outlook form, you do not create the Application object, and you cannot use named constants. This example shows how to perform the same task using VBScript code.

Sub CreateMailItem()
    Set myItem = Application.CreateItem(olMailItem)
    MsgBox myItem.Application.Version
End Sub

Applies to | Action Object | Actions Object | AddressEntries Object | AddressEntry Object | AddressList Object | AddressLists Object | Application Object | AppointmentItem Object | Attachment Object | Attachments Object | Conflict Object | Conflicts Object | ContactItem Object | DistListItem Object | DocumentItem Object | Exception Object | Exceptions Object | Explorer Object | Explorers Object | Folders Object | FormDescription Object | Inspector Object | Inspectors Object | ItemProperties Collection | ItemProperty Object | Items Object | JournalItem Object | Link Object | Links Object | MailItem Object | MAPIFolder Object | MeetingItem Object | NameSpace Object | NoteItem Object | OutlookBarGroup Object | OutlookBarGroups Object | OutlookBarPane Object | OutlookBarShortcut Object | OutlookBarShortcuts Object | OutlookBarStorage Object | Pages Object | Panes Object | PostItem Object | PropertyPages Object | PropertyPageSite Object | Recipient Object | Recipients Object | RecurrencePattern Object | Reminder Object | Reminders Collection | RemoteItem Object | ReportItem Object | Results Collection | Search Object | Selection Object | SyncObject Object | SyncObjects Object | TaskItem Object | TaskRequestAcceptItem Object | TaskRequestDeclineItem Object | TaskRequestItem Object | TaskRequestUpdateItem Object | UserProperties Object | UserProperty Object | View Object | Views Collection

See Also | CreateObject Method