'How to Give 'PickFolder' dialogue a title

I'm writing some code in which the user will need to pick both a source folder and destination folder using:

Set SourceFolder = GetObject("", "Outlook.Application").GetNamespace("MAPI").PickFolder

Set TargetFolder = GetObject("", "Outlook.Application").GetNamespace("MAPI").PickFolder

Is there a way to give the folder selector dialogue a heading so that I don't have to use a message box or something to tell the user which folder they are picking each time?



Solution 1:[1]

Not in Outlook Object Model. You can either

a. Create your own form with the required functionality
b. If using Redemption (I am its author) is an option, it exposes the RDOSelectFolder object, which allows to set the dialog caption (besides other things):

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

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1