JakeyG
JakeyG

Reputation: 110

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?

Upvotes: 1

Views: 793

Answers (1)

Dmitry Streblechenko
Dmitry Streblechenko

Reputation: 66306

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

Upvotes: 0

Related Questions