SelectNamesDialog.Display Method (Outlook)
Displays the Select Names dialog box.
expression A variable that represents a SelectNamesDialog object.
A Boolean value that is True if the user has clicked OK, and False if the user has clicked Cancel or the Close icon.
When displaying the Select Names dialog box, Display uses the previous location and size (indicated by the top, left, width, and height) of the dialog box.
The Select Names dialog box is modal, meaning that code execution will halt until the user clicks OK, Cancel, or the close icon.
You should detect for error conditions that include insufficient memory or another message or dialog box is open.
The following code sample shows how to create a mail item, allow the user to select recipients from the Exchange Global Address List in the Select Names dialog box, and if the user has selected recipients that can be completely resolved, then send the mail item.
Sub SelectRecipients() Dim oMsg As MailItem Set oMsg = Application.CreateItem(olMailItem) Dim oDialog As SelectNamesDialog Set oDialog = Application.Session.GetSelectNamesDialog With oDialog .InitialAddressList = _ Application.Session.GetGlobalAddressList .Recipients = oMsg.Recipients If .Display Then 'Recipients Resolved oMsg.Subject = "Hello" oMsg.Send End If End With End Sub