RootFolder Property (InfoStore Object)

The RootFolder property returns a Folder object representing the root of the IPM subtree for the InfoStore object. Read-only.

Syntax

Set objFolder = objInfoStore.RootFolder

Data Type

Object (Folder)

Remarks

The RootFolder property provides a convenient way to get to this commonly used Folder object.

In addition to the general ability to navigate through the formal collection and object hierarchy, CDO supports properties that allow your application to directly access the most common Folder objects:

Some message stores also support a direct way to obtain the root folder of the message store. For more information, see the Session object's GetFolder method.

If your application is running as a Microsoft® Windows NT® service, you cannot access the Microsoft Exchange Public Folders through the normal hierarchy because of a notification conflict. You must use the InfoStore's Fields property to obtain the Microsoft Exchange property PR_IPM_PUBLIC_FOLDERS_ENTRYID, property tag &H66310102. This represents the top-level public folder and allows you to access all other public folders through its Folders property. For more information on Windows NT services, see the Win32® Web page Using MAPI from a Windows NT Service at http://www.microsoft.com/win32dev/mapi/mapiserv.htm.

Example

' from InfoStores_RootFolder 
    If objInfoStore Is Nothing Then 
        MsgBox "must first select an InfoStore object" 
        Exit Function 
    End If 
    Set objFolder = objInfoStore.RootFolder 
    If objFolder Is Nothing Then 
        MsgBox "Unable to retrieve IPM root folder" 
        Set objMessages = Nothing 
        Exit Function 
    End If 
    If objFolder.Name = "" Then 
        MsgBox "Folder set to folder with no name, ID = " _ 
                                                   & objFolder.ID 
    Else 
        MsgBox "Folder set to: " & objFolder.Name 
    End If 
    Set objMessages = objFolder.Messages 
    Exit Function