_NameSpace.GetDefaultFolder Method

Returns a Folder object that represents the default folder of the requested type for the current profile, for example, obtains the default Calendar folder for the user who is currently logged on.

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

Syntax

'Declaration
Function GetDefaultFolder ( _
    FolderType As OlDefaultFolders _
) As MAPIFolder
'Usage
Dim instance As _NameSpace
Dim FolderType As OlDefaultFolders
Dim returnValue As MAPIFolder

returnValue = instance.GetDefaultFolder(FolderType)
MAPIFolder GetDefaultFolder(
    OlDefaultFolders FolderType
)

Parameters

Return Value

Type: Microsoft.Office.Interop.Outlook.MAPIFolder
A Folder object that represents the default folder of the requested type for the current profile. If the default folder of the requested type does not exist, for example, because olFolderManagedEmail is specified as the FolderType but the Managed Folders group has not been deployed, then GetDefaultFolder will return Nothing (a null reference (Nothing in Visual Basic) in C#).

Remarks

To return a specific non-default folder, use the Folders collection.

See Also

Reference

_NameSpace Interface

_NameSpace Members

Microsoft.Office.Interop.Outlook Namespace