RDOFolders object collection

 

RDOFolders collection represents the subfolders of a given RDOFolder object.

Returned by: RDOFolder.Folders

 

The example below logs to the default MAPI session and prints out the names of all the subfolders of the root IPM folder of the default store:

set Session = CreateObject("Redemption.RDOSession")
Session.Logon
set IPMRoot = Session.Stores.DefaultStore.IPMRootFolder
for each Folder in IPMRoot.Folders
  Debug.Print(Folder.Name)
next

 

Properties

Methods

Events

 


Derived from: IDispatch


Properties


Count

integer. Returns the number of folders in the collection

set Session = CreateObject("Redemption.RDOSession")
Session.Logon
set Folder = Session.Stores.DefaultStore.IPMRootFolder.Folders("Test folder")
MsgBox "Number of subfolders: " & Folder.Folders.Count

_Item(Index)

Index - variant: integer or a string. A default object property.

Retrieves a subfolder with a given index (1 to Count) or a given name

Returns RDOFolder object

 

RawTable

IUnknown, read-only. Returns the IMAPITable Extended MAPI interface used internally by the RDOItems collection

 

Session

RDOSession, read-only. Returns the parent MAPI session represented by the RDOSession object

 

MAPITable

MAPITable, read-only. Returns the MAPITable Redemption object which can be used to manipulate the collection (restrict, find, etc).

 

Methods


Item(Index)

Index - variant: integer or a string.

Retrieves a subfolder with a given index (1 to Count) or a given name

Returns RDOFolder object

 

Add(Name, Type)

Adds new subfolder to the specified folder. Returns an RDOFolder object.

Name - string. The name of the folder to add

Type - variant, optional. If specified, can be either one of the rdoDefaultFolders enums (olFolderCalendar, olFolderContacts, etc) or a string representing the container class (PR_CONTAINER_CLASS in Extended MAPI), e.g. "IPF.Contact"

set Session = CreateObject("Redemption.RDOSession")
Session.Logon
set IPMRoot = Session.Stores.DefaultStore.IPMRootFolder
set NewFld = IPMRoot.Folders.Add("Test Folder")

AddSearchFolder(Name, Type)

Adds new search folder to the specified folder. Returns an RDOSearchFolder object.

Name - string. The name of the search folder to add

Type - variant, optional. If specified, can be either one of the OlDefaultFolders enums (olFolderCalendar, olFolderContacts, etc) or a string representing the container class (PR_CONTAINER_CLASS in Extended MAPI), e.g. "IPF.Contact"

 

GetFirst

Returns the first folder in the specified RDOFolders collection. Returns Nothing if no first folder exists, for example, if there are no subfolders.

 

GetLast

Returns the last folder in the specified RDOFolders collection. Returns Nothing if no last folder exists, for example, if there are no subfolders.

 

GetNext

Returns the next folder in the specified RDOFolders collection. It returns Nothing if no next folder exists, for example, if already positioned at the end of the collection.

 

GetPrevious

Returns the previous folder in the specified RDOFolders collection. It returns Nothing if no previous folder exists, for example, if already positioned at the beginning of the collection.

 

Remove(Index)

Deletes a subfolder with the specified index (1 to Count)

Index - integer, 1 through Count

 


Events:


FolderChange(Folder)

Fires when a subfolder in the hierarchy table is modified.

Folder - RDOFolder object

 

FolderAdd(Folder)

Fires when a new subfolder is added to the hierarchy table.

Folder - RDOFolder object

Dim WithEvents InboxFolders As Redemption.RDOFolders
...

Set Session = New Redemption.RDOSession
Session.Logon
Set Store = Session.Stores.DefaultStore
Set Inbox = Store.GetDefaultFolder(olFolderInbox)
Set InboxFolders = Inbox.Folders
...

Sub InboxFolders_FolderAdd(ByVal Folder As RDOFolder)
  MsgBox "New subfolder added to the Inbox: " & Folder.Name
End Sub

FolderRemove(InstanceKey)

Fires when a folder is removed from the hierarchy table.
By the time this asynchronous even is fired, the folder is already deleted, hence no entry id is available.

InstanceKey - a hex value of the PR_INSTANCE_KEY property of the deleted table row. Note that PR_INSTANCE_KEY is not available from the folder itself, only from the MAPI table (see MAPITable property). InstanceKey is only guaranteed to be the same for the same instance of the table, hence this event is useful only if the value of PR_INSTANCE_KEY was previously cached.

 

CollectionModified

Fires when the hierarchy table is modified and the underlying MAPI implementation cannot provide more detailed information about the change, e.g. when too many folders were modified at the same time.

When the event fires, it must be assumed that the entire contents of the collection are no longer valid.