Export (0) Print
Expand All

_Store.GetDefaultFolder Method

Returns a MAPIFolder object that represents the default folder in the store and that is of the type specified by the FolderType argument.

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

[DispIdAttribute()]
MAPIFolder GetDefaultFolder(
	OlDefaultFolders FolderType
)

Parameters

FolderType
Type: Microsoft.Office.Interop.Outlook.OlDefaultFolders
Specifies the type of the requested default folder.

Return Value

Type: Microsoft.Office.Interop.Outlook.MAPIFolder
Returns a Folder object that represents the default folder of the requested type. If the default folder of the requested type does not exist, GetDefaultFolder returns Nothing (a null reference (Nothing in Visual Basic) in C#).

This method is similar to the GetDefaultFolder(OlDefaultFolders) method of the NameSpace object. The difference is that this method gets the default folder on the delivery store that is associated with the account, whereas GetDefaultFolder of the NameSpace object returns the default folder on the default store for the current profile.

One example of when GetDefaultFolder returns Nothing (a null reference (Nothing in Visual Basic) in C#) is when olFolderManagedEmail is specified as the FolderType but the Managed Folders group has not been deployed.

Community Additions

ADD
Show:
© 2014 Microsoft