Folder interface

Represents an Outlook folder.

Namespace:  Microsoft.Office.Interop.Outlook
Assembly:  Microsoft.Office.Interop.Outlook (in Microsoft.Office.Interop.Outlook.dll)

public interface Folder : MAPIFolder, MAPIFolderEvents_12_Event

This is a .NET interface derived from a COM coclass that is required by managed code for interoperability with the corresponding COM object. Use this interface to access all method, property, and event members of the COM object Folder. Refer to this topic for information about the COM object. For information about the method and property members of the COM object, see MAPIFolder. For information about the event members of the COM object, see MAPIFolderEvents_12_Event.

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. You can navigate nested folders by starting from a top-level folder, say the Inbox, and using a combination of the MAPIFolder.Folders property, which returns the set of folders underneath a Folder object in the hierarchy, and the _Folders.Item property (this in C#), which returns a folder within the Folders collection.

There is a set of folders within an Outlook data store that supports the default functionality of 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. 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.

Use the _Folders.Add method to add a folder to the Folders object. 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. 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.