O'Reilly logo

CDO & MAPI Programming with Visual Basic: by Dave Grundgeiger

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Showing the Address Book

If you’re writing an application that allows the user to enter recipients for an outgoing message, it’s convenient for the user to have a way to display the address book, and to select recipients directly from the address book. In CDO, this is done by calling the Session object’s AddressBook method. The syntax of the AddressBook method is:

Set CdoRecipients = CdoSession.AddressBook([Recipients][, Title][, OneAddress]
[, ForceResolution][,
RecipLists][,
ToLabel][,
CcLabel][,
BccLabel][, 

ParentWindow])

Note that all of the parameters are optional. Here is how each is used:

Recipients

A Recipients collection object that is used to populate the addresses in the dialog box. The user can then select additional addresses and/or deselect addresses that were previously selected. If the parameter is omitted, the displayed dialog box doesn’t have any recipients selected initially.

Title

A string that is used as the dialog box’s caption. The default value is an empty string.

OneAddress

When this Boolean parameter is set to True, the user is permitted to select at most a single recipient. When it is False (the default), the user is allowed to select multiple recipients.

ForceResolution

When this Boolean parameter is set to True, the AddressBook method attempts to resolve all names prior to returning. If it has trouble doing so, it displays an address resolution dialog box to the user, as shown in Figure 6-6. If this parameter is set to False, the AddressBook method ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required