NameSpace.GetDefaultFolder Method
Outlook Developer Reference |
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.
Syntax
expression.GetDefaultFolder(FolderType)
expression A variable that represents a NameSpace object.
Parameters
Name | Required/Optional | Data Type | Description |
---|---|---|---|
FolderType | Required | OlDefaultFolders | The type of default folder to return. |
Return Value
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 Null (Nothing in Visual Basic).
Remarks
To return a specific non-default folder, use the Folders collection.
Example
This Visual Basic for Applications (VBA) example uses the CurrentFolder property to change the displayed folder to the user's default Calendar folder.
Visual Basic for Applications |
---|
|
This VBA example returns the first folder in the Tasks Folders collection.
Visual Basic for Applications |
---|
|
See Also