RDOSelectFoldersDialog object

 

RDOSelectFoldersDialog allows to select one or multiple folders and supports wide customization capabilities - programmatically determining which folders are shown, modifying button captions, etc. The old RDOSesssion.PickFolder method can still be used.

 

Use RDOSelectFoldersDialog events to prevent the dialog from closing (OnBeforeClose event), hide some folders (OnShowFolder event), or disable the Ok button when a particular folder is selected (OnSelectFolder event)

 

Returned by:

RDOSession.GetSelectFoldersDialog

 

The example below displays the "Select Folder dialog".

set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Application.Session.MAPIOBJECT
set SelectFoldersDialog = Session.GetSelectFoldersDialog
if SelectFoldersDialog.Display Then
    set Folder = SelectFoldersDialog.SelectedFolder
    MsgBox "selected folder: " & Folder.Name
End If

Select Folders Diaalog

 

 

The following example allows to select multiple dialogs (checkboxes) and pre-selects Inbox and Sent Items folders.

set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Application.Session.MAPIOBJECT
set SelectFoldersDialog = Session.GetSelectFoldersDialog
SelectFoldersDialog.AllowMultipleSelection = true
SelectFoldersDialog.Caption = "Please select the folders to process"
SelectFoldersDialog.OkCaption = "Done"
SelectFoldersDialog.ShowNewButton = false
'preselect Inbox and Sent Items folders
SelectFoldersDialog.SelectedEntryIds.Add(Session.GetDefaultFolder(olFolderInbox).EntryId)
SelectFoldersDialog.SelectedEntryIds.Add(Session.GetDefaultFolder(olFolderSentMail).EntryId)
'show the dialog
if SelectFoldersDialog.Display Then
    Debug.Print "Selected folders:"
    Debug.Print "-----------------"
    for each strEntryId in SelectFoldersDialog.SelectedEntryIds
        set Fld = session.getFolderFromId(strEntryId)
        Debug.Print Fld.Name
    next
End If

SElect Folders dialog with checkboxes

 

 

Properties

Methods

Events

 


Derived from: IDispatch


Properties


AllowedContainerClass String, read/write.
Allows only a particular folder types to be displayed, e.g. "IPF.Contact" will only allows the contacts folders to be displayed.
 
 
AllowMultipleSelection Boolean, read/write.
If true, displays the check boxes next to the folder names (see the screenshot above).
To specify pre-selected folders, and access the selected folders after calling Display, use the SelectedEntryIds property.
 
See example above
AllowSizing Boolean, read/write.
If true, the dialog can be resized.
 
 
CancelCaption String, read/write.
The text displayed by the Cancel button.
 
 
Caption String, read/write.
The caption of the dialog box.
 
 
CloseOnDoubleClick
Boolean, read/write. Default value: true;
If true, the dialog is closed when the user double clicks on a folder.
 
Height
Integer, read/write.
Specifies the dialog height (in pixels).
 
LabelCaption String, read/write.
The text of the label located just above the tree view.
 
 
Left Integer, read/write/
Specifies the position (in pixels) of the dialog's left side.
 
MinHeight
Integer, read/write/
Specifies the minimum height (in pixels) of the dialog.
 
MinWidth
Integer, read/write/
Specifies the minimum width (in pixels) of the dialog.
 
NewCaption String, read/write.
The text displayed by the "New..." button.
 
 
OkCaption String, read/write.
The text displayed by the Ok button.
 
 
ParentWindow

Object, read/write.

This can be set either to a window handle (HWND) or to an object that supports the IOleWindow interface (such as Explorer or Inspector objects in the Outlook Object Model).

Setting this property to 1 forces Redemption to use the value returned by the GetForegroundWindow Windows API function, setting it to 2 uses the value from GetDesktopWindow.

  

 
SelectedEntryIds Strings, read/write.
The collection that holds the entry ids of the selected folders. This property is only used if the AllowMultipleSelection property is set to true.
 
See example above
SelectedFolder RDOFolder, read/write.
 
 
ShowNewButton Boolean, read/write.
If true, the "New.." button is shown.
 
 
ShowParentFolders Boolean, read/write.
if false, only the folder specified by the SelectedFolder property and its child folders are shown.
 
set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Application.Session.MAPIOBJECT
set dlg = Session.GetSelectFoldersDialog
dlg.SelectedFolder = Session.GetDefaultFolder(olFolderContacts)
dlg.ShowParentFolders = false
if dlg.Display Then
    set Folder = dlg.SelectedFolder
    MsgBox "selected folder: " & Folder.Name
End If

ShowParwntFolders=false
ShowPublicFolders Boolean, read/write.
If false, Public Folders store is not shown.
 
 
ShowStoresOnly Boolean, read/write.
If true, only the top level stores are shown.
 
set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Application.Session.MAPIOBJECT
set dlg = Session.GetSelectFoldersDialog
dlg.ShowStoresOnly = true
if dlg.Display Then
   
set Folder = dlg.SelectedFolder
   
MsgBox "selected folder: " & Folder.Name
End If

ShowStoresOnly = true
Top
Integer, read/write.
Specifies the position (in pixels) of the dialog's top.
 
Width
Integer, read/write.
Specifies the dialog width (in pixels).
 

Methods


Display Displays the dialog box.
Returns true if the user clicked the Ok button, and false if Cancel button.
 

Events:


OnBeforeClose
(Cancel)
 
Fires before the dialog closes.
Set the Cancel parameter to true to prevent the dialog from closing,

Cancel - boolean, in/out.
 
 
OnSelectFolder
(Folder, EnableOkButton)
 
Fires when a node presenting a folder is selected in the tree view.
Set EnableOkButton parameter to false to disable the Ok button.

Folder - RDOFolder object representing the selected folder.

EnableOkButton  - Boolean, in/out.
 
 
OnShowFolder
(Folder, ShowFolder)
 
Fires when RDOSelectFoldersDialog object determines whether the folder in question must be shown. Set the ShowFolder parameter to false to prevent the folder from being displayed in the tree view.

Folder - RDOFolder object representing the selected folder.

ShowFolder - Boolean, in/out.