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 it. The MAPIMessages control makes this easy. Before continuing, however, note what the MAPI controls can’t do with the address book. The controls can’t programmatically manipulate the address book in any way. There isn’t even a way to enumerate the entries in the address book.
Now let’s talk about what the controls can
do. The Show method of the MAPIMessages
control, when called with no argument or with the argument set to
False, displays the user’s address book. The
UI is provided for you by the system. If you’ve
programmatically set any recipients prior to showing the address
book, these recipients will be shown as selected in the address book
dialog box. Similarly, new selections or deletions made by the user
in the address book dialog box are reflected in the MAPIMessages
control’s recipient list immediately upon returning from the
Show method.
By default, the address book allows the user to select only primary recipients, not copy or blind copy recipients. To change this behavior, set the AddressEditFieldCount property prior to calling the Show method. The default value is 1. Setting this property to causes the address book dialog box to disallow any selections at all. That is, the user is only allowed to browse the address book. Setting this ...