How to: Display a Dialog Box for Selecting Entries from the Contacts Folder
|Outlook Developer Reference|
This topic describes how to use the SelectNamesDialog object to display entries from the Contacts folder in a dialog box that resembles the Select Names dialog box in the Outlook user interface.
- Look for the address list that corresponds with the Contacts folder.
The SelectNamesDialog object displays entires in a dialog box based on an AddressList. To display entries in the Contacts folder, look for the AddressList that corresponds with the Contacts folder. Iterate through all the address lists defined for the current session, and for each address list, use AddressList.GetContactsFolder to match the corresponding folder with the Contacts folder.
- Initialize the dialog box with the address list of the Contacts folder.
- Use SelectNamesDialog.Display to display the dialog box. If SelectNamesDialog.Display returns True, then selected entries will be available in SelectNamesDialog.Recipients.