Folder 对象(Outlook)Folder object (Outlook)

代表 Outlook 文件夹。Represents an Outlook folder.

备注Remarks

一个 文件夹 可以包含其他 文件夹 对象以及 Outlook 项目。A Folder object can contain other Folder objects, as well as Outlook items. 使用 命名空间 对象或另一个 文件夹 对象的 文件夹 属性在 命名空间 中或文件夹下返回的一组文件夹。Use the Folders property of a NameSpace object or another Folder object to return the set of folders in a NameSpace or under a folder. 您可以通过从顶级文件夹,说收件箱,并使用 Folder.Folders 的组合导航嵌套的文件夹 属性,它返回层次结构中的一组文件夹下一个 Folder 对象,并返回 Folders 集合内的某个文件夹的 Folders.Item 方法。You can navigate nested folders by starting from a top-level folder, say the Inbox, and using a combination of the Folder.Folders property, which returns the set of folders underneath a Folder object in the hierarchy, and the Folders.Item method, which returns a folder within the Folders collection.

Outlook 数据存储区内有一个支持 Outlook 默认功能的文件夹集合。There is a set of folders within an Outlook data store that supports the default functionality of Outlook. 使用**GetDefaultFolder,指定一个索引,该_索引_是OlDefaultFolders** 枚举中的常量之一,以返回 outlook命名空间对象中的一个默认 Outlook 文件夹。Use NameSpace.GetDefaultFolder, specifying an index that is one of the constants in the OlDefaultFolders enumeration to return one of the default Outlook folders in the Outlook NameSpace object.

虽然通常情况下最好将提供相同功能的项目放在相同的文件夹内,但是一个文件夹也可包含不同类型的项目。While generally it is a good practice to place items that serve the same functionality in the same folder, a folder can contain items of different types. 例如,默认情况下"日历"文件夹可以包含 AppointmentItemMeetingItem 对象,"联系人"文件夹可以包含 ContactItemDistListItem 对象。For example, by default, the Calendar folder can contain AppointmentItem and MeetingItem objects, and the Contacts folder can contain ContactItem and DistListItem objects. 一般来说,当枚举文件夹中的项目时,请不要假设文件夹中项目的类型;而要在访问适用于该项目的属性前检查该项目的邮件类。In general, when enumerating items in a folder, do not assume the type of an item in the folder; check the message class of the item before accessing properties that are applicable to the item.

使用 Folders.Add 方法将文件夹添加到 文件夹 对象。Use the Folders.Add method to add a folder to the Folders object. Add 方法有一个可选参数,用于指定可在该文件夹中存储的项目类型。The Add method has an optional argument that can be used to specify the type of items that can be stored in that folder. 默认情况下,在另一个文件夹内创建文件夹继承其父文件夹的类型。By default, folders created inside another folder inherit the type of the parent folder.

请注意,保存特定类型的项目时,他们会直接保存到相应的默认文件夹。Note that when items of a specific type are saved, they are saved directly into their corresponding default folder. 例如,当 MeetingItem.GetAssociatedAppointment 方法应用于 MeetingItem 在收件箱文件夹中,则返回该约会将保存到默认的日历文件夹。For example, when the MeetingItem.GetAssociatedAppointment method is applied to a MeetingItem in the Inbox folder, the appointment that is returned will be saved to the default Calendar folder.

事件Events

名称Name
BeforeFolderMoveBeforeFolderMove
BeforeItemMoveBeforeItemMove

方法Methods

名称Name
AddToPFFavoritesAddToPFFavorites
CopyToCopyTo
删除Delete
DisplayDisplay
GetCalendarExporterGetCalendarExporter
GetCustomIconGetCustomIcon
GetExplorerGetExplorer
GetStorageGetStorage
GetTableGetTable
MoveToMoveTo
SetCustomIconSetCustomIcon

属性Properties

名称Name
AddressBookNameAddressBookName
应用程序Application
Class
CurrentViewCurrentView
CustomViewsOnlyCustomViewsOnly
DefaultItemTypeDefaultItemType
DefaultMessageClassDefaultMessageClass
说明Description
EntryIDEntryID
FolderPathFolderPath
文件夹Folders
InAppFolderSyncObjectInAppFolderSyncObject
IsSharePointFolderIsSharePointFolder
ItemsItems
名称Name
ParentParent
PropertyAccessorPropertyAccessor
SessionSession
ShowAsOutlookABShowAsOutlookAB
ShowItemCountShowItemCount
存储区Store
StoreIDStoreID
UnReadItemCountUnReadItemCount
UserDefinedPropertiesUserDefinedProperties
视图Views
WebViewOnWebViewOn
WebViewURLWebViewURL

另请参阅See also

Outlook 对象模型引用 Folder 对象成员Outlook Object Model Reference Folder Object Members

支持和反馈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.