Folder Interface

Definition

Represents an Outlook folder.

public interface class Folder : Microsoft::Office::Interop::Outlook::MAPIFolder, Microsoft::Office::Interop::Outlook::MAPIFolderEvents_12_Event
[System.Runtime.InteropServices.Guid("00063006-0000-0000-C000-000000000046")]
public interface Folder : Microsoft.Office.Interop.Outlook.MAPIFolder, Microsoft.Office.Interop.Outlook.MAPIFolderEvents_12_Event
Public Interface Folder
Implements MAPIFolder, MAPIFolderEvents_12_Event
Derived
Attributes
Implements

Remarks

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 Folders property, which returns the set of folders underneath a Folder object in the hierarchy, and the Item[Object] 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 GetDefaultFolder(OlDefaultFolders), 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 Add(String, Object) 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 GetAssociatedAppointment(Boolean) method is applied to a MeetingItem in the Inbox folder, the appointment that is returned will be saved to the default Calendar folder.

Properties

AddressBookName

Returns or sets a String (string in C#) that indicates the Address Book name for the Folder object representing a Contacts folder. Read/write.

(Inherited from MAPIFolder)
Application

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

(Inherited from MAPIFolder)
Class

Returns an OlObjectClass constant indicating the object's class. Read-only.

(Inherited from MAPIFolder)
CurrentView

Returns a View object representing the current view. Read-only.

(Inherited from MAPIFolder)
CustomViewsOnly

Returns or sets a Boolean (bool in C#) that determines which views are displayed on the View menu for a given folder. Read/write.

(Inherited from MAPIFolder)
DefaultItemType

Returns a constant from the OlItemType enumeration indicating the default Outlook item type contained in the folder. Read-only.

(Inherited from MAPIFolder)
DefaultMessageClass

Returns a String (string in C#) representing the default message class for items in the folder. Read-only.

(Inherited from MAPIFolder)
Description

Returns or sets a String (string in C#) representing the description of the folder. Read/write.

(Inherited from MAPIFolder)
EntryID

Returns a String (string in C#) representing the unique Entry ID of the object. Read-only.

(Inherited from MAPIFolder)
FolderPath

Returns a String (string in C#) that indicates the path of the current folder. Read-only.

(Inherited from MAPIFolder)
Folders

Returns the Folders collection that represents all the folders contained in the specified Folder. Read-only.

(Inherited from MAPIFolder)
FullFolderPath

This object, member, or enumeration is deprecated and is not intended to be used in your code.

(Inherited from MAPIFolder)
InAppFolderSyncObject

Returns or sets a Boolean (bool in C#) that determines if the specified folder will be synchronized with the e-mail server. Read/write.

(Inherited from MAPIFolder)
IsSharePointFolder

Returns a Boolean (bool in C#) that determines if the folder is a Microsoft SharePoint Foundation folder. Read-only.

(Inherited from MAPIFolder)
Items

Returns an Items collection object as a collection of Outlook items in the specified folder. Read-only.

(Inherited from MAPIFolder)
MAPIOBJECT

This object, member, or enumeration is deprecated and is not intended to be used in your code.

(Inherited from MAPIFolder)
Name

Returns or sets a String (string in C#) value that represents the display name for the object. Read/write.

(Inherited from MAPIFolder)
Parent

Returns the parent Object of the specified object. Read-only.

(Inherited from MAPIFolder)
PropertyAccessor

Returns a PropertyAccessor object that supports creating, getting, setting, and deleting properties of the parent Folder object. Read-only.

(Inherited from MAPIFolder)
Session

Returns the NameSpace object for the current session. Read-only.

(Inherited from MAPIFolder)
ShowAsOutlookAB

Returns or sets a Boolean (bool in C#) value that specifies whether the contact items folder will be displayed as an address list in the Outlook Address Book. Read/write.

(Inherited from MAPIFolder)
ShowItemCount

Sets or returns a constant in the OlShowItemCount enumeration that indicates whether to display the number of unread messages in the folder or the total number of items in the folder in the Navigation Pane. Read/write.

(Inherited from MAPIFolder)
Store

Returns a Store object representing the store that contains the Folder object. Read-only.

(Inherited from MAPIFolder)
StoreID

Returns a String (string in C#) indicating the store ID for the folder. Read-only.

(Inherited from MAPIFolder)
UnReadItemCount

Returns an Integer (int in C#) value indicating the number of unread items in the folder. Read-only.

(Inherited from MAPIFolder)
UserDefinedProperties

Returns a UserDefinedProperties object that represents the user-defined custom properties for the Folder object. Read-only.

(Inherited from MAPIFolder)
UserPermissions

This object, member, or enumeration is deprecated and is not intended to be used in your code.

(Inherited from MAPIFolder)
Views

Returns the Views collection of the Folder object. Read-only.

(Inherited from MAPIFolder)
WebViewAllowNavigation

This object, member, or enumeration is deprecated and is not intended to be used in your code.

(Inherited from MAPIFolder)
WebViewOn

Returns or sets a Boolean (bool in C#) indicating the Web view state for a folder. Read/write.

(Inherited from MAPIFolder)
WebViewURL

Returns or sets a String (string in C#) indicating the URL of the Web page that is assigned to a folder. Read/write.

(Inherited from MAPIFolder)

Methods

AddToFavorites(Object, Object)

This object, member, or enumeration is deprecated and is not intended to be used in your code.

(Inherited from MAPIFolder)
AddToPFFavorites()

Adds a Microsoft Exchange public folder to the public folder's Favorites folder.

(Inherited from MAPIFolder)
CopyTo(MAPIFolder)

Copies the current folder in its entirety to the destination folder.

(Inherited from MAPIFolder)
Delete()

Deletes an object from the collection.

(Inherited from MAPIFolder)
Display()

Displays a new Explorer object for the folder.

(Inherited from MAPIFolder)
GetCalendarExporter()

Creates a CalendarSharing object for the specified Folder.

(Inherited from MAPIFolder)
GetCustomIcon()

Returns an StdPicture object that represents the custom icon for the folder.

(Inherited from MAPIFolder)
GetExplorer(Object)

Returns an Explorer object that represents a new, inactive Explorer object initialized with the specified folder as the current folder.

(Inherited from MAPIFolder)
GetStorage(String, OlStorageIdentifierType)

Gets a StorageItem object on the parent Folder to store data for an Outlook solution.

(Inherited from MAPIFolder)
GetTable(Object, Object)

Obtains a Table object that contains items filtered by Filter.

(Inherited from MAPIFolder)
MoveTo(MAPIFolder)

Moves a folder to the specified destination folder.

(Inherited from MAPIFolder)
SetCustomIcon(StdPicture)

Sets a custom icon that is specified by Picture for the folder.

(Inherited from MAPIFolder)

Events

BeforeFolderMove

Occurs when a folder is about to be moved or deleted, either as a result of user action or through program code.

(Inherited from MAPIFolderEvents_12_Event)
BeforeItemMove

Occurs when an item is about to be moved or deleted from a folder, either as a result of user action or through program code.

(Inherited from MAPIFolderEvents_12_Event)

Applies to