应用程序对象 (Outlook)Application Object (Outlook)

代表整个 Microsoft Outlook 应用程序。Represents the entire Microsoft Outlook application.

注解Remarks

这是可以通过使用 无论 返回层次结构中的唯一对象 方法或内部的 Visual Basic GetObject 函数。This is the only object in the hierarchy that can be returned by using the CreateObject method or the intrinsic Visual Basic GetObject function.

Outlook应用程序对象具有以下几种用途:The Outlook Application object has several purposes:

  • 作为根对象,允许访问 Outlook 层次结构中的其他对象。As the root object, it allows access to other objects in the Outlook hierarchy.

  • 它允许直接访问使用**CreateItem** 创建的新项目, 而不必遍历对象层次结构。It allows direct access to a new item created by using CreateItem, without having to traverse the object hierarchy.

  • 允许访问活动界面对象(浏览器和检查器)。It allows access to the active interface objects (the explorer and the inspector).

当您使用 "自动化" 从其他应用程序控制 outlook 时, 可以使用CreateObject方法创建 outlook应用程序对象。When you use Automation to control Outlook from another application, you use the CreateObject method to create an Outlook Application object.

示例Example

下面的 Visual Basic for Applications (VBA) 示例启动 Outlook(如果它尚未运行)并打开默认的“收件箱”文件夹。The following Visual Basic for Applications (VBA) example starts Outlook (if it's not already running) and opens the default Inbox folder.

Set myNameSpace = Application.GetNameSpace("MAPI") 
 
Set myFolder= _ 
 
 myNameSpace.GetDefaultFolder(olFolderInbox) 
 
myFolder.Display

下面的 Visual Basic for Applications (VBA) 示例使用Application对象创建并打开一个新的联系人。The following Visual Basic for Applications (VBA) example uses the Application object to create and open a new contact.

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

事件Events

名称Name
AdvancedSearchCompleteAdvancedSearchComplete
AdvancedSearchStoppedAdvancedSearchStopped
BeforeFolderSharingDialogBeforeFolderSharingDialog
ItemLoadItemLoad
ItemSendItemSend
MAPILogonCompleteMAPILogonComplete
NewMailNewMail
NewMailExNewMailEx
OptionsPagesAddOptionsPagesAdd
QuitQuit
提醒Reminder
启动Startup

方法Methods

名称Name
ActiveExplorerActiveExplorer
ActiveInspectorActiveInspector
ActiveWindowActiveWindow
AdvancedSearchAdvancedSearch
CopyFileCopyFile
CreateItemCreateItem
CreateItemFromTemplateCreateItemFromTemplate
CreateObjectCreateObject
GetNamespaceGetNamespace
GetObjectReferenceGetObjectReference
IsSearchSynchronousIsSearchSynchronous
QuitQuit
RefreshFormRegionDefinitionRefreshFormRegionDefinition

属性Properties

名称Name
ApplicationApplication
AssistanceAssistance
Class
COMAddInsCOMAddIns
DefaultProfileNameDefaultProfileName
资源管理器Explorers
检查器Inspectors
IsTrustedIsTrusted
LanguageSettingsLanguageSettings
名称Name
ParentParent
PickerDialogPickerDialog
ProductCodeProductCode
提醒Reminders
SessionSession
TimeZonesTimeZones
VersionVersion

另请参阅See also

Outlook 对象模型引用Outlook Object Model Reference

支持和反馈Support and feedback

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.