Store.GetRootFolder Method
Outlook Developer Reference |
Returns a Folder object representing the root-level folder of the Store. Read-only.
Version Information
Version Added: Outlook 2007
Syntax
expression.GetRootFolder
expression A variable that represents a Store object.
Return Value
A Folder object that represents the folder at the root of that Store.
Remarks
You can use the GetRootFolder method to enumerate the subfolders of the root folder of the Store. Unlike NameSpace.Folders which contains all folders for all stores in the current profile, Store.GetRootFolder.Folders allows you to enumerate all folders for a given Store object in the current profile.
The Parent property of the root folder of a store returns the string "Mapi".
The root folder for the Exchange Public Folder store is the folder Public Folders. This folder is returned by the call to Application.Session.GetDefaultFolder(olPublicFoldersAllPublicFolders)
.
GetRootFolder returns an error if the service provider does not support root folders.
Example
The following code sample in Microsoft Visual Basic for Applications (VBA) starts at the root-level folder of each Store in a Stores collection for a session, and enumerates all folders on all stores for that session.
Visual Basic for Applications |
---|
|
See Also