Article ID: 193457 - Last Review: November 23, 2006 - Revision: 1.2 OL98: Using Address Books in an Outlook SolutionThis article was previously published under Q193457 On This PageSUMMARY
This article provides an overview of data that you have access to in
address books. It also discusses how you can programmatically display an
address book dialog box.
MORE INFORMATIONAccessing Address Book DataUsing the Microsoft Outlook 98 object model, you can access information that is stored in various address books. For example, you can retrieve information about entries in the Global Address Book or a user's Personal Address Book. To see the type of information you have access to, consult the AddressEntries Object topic in the Microsoft Outlook Visual Basic Help file (Vbaoutl.hlp). Click the Properties on that page to see the list of properties available for an entry in an address book.If you want to access additional entries that are typically available for a recipient (such as Office, Title or Phone) you can use the Collaboration Data Objects (CDO) object model. For more information about accessing these properties using CDO, please see the following articles in the Microsoft Knowledge Base: 179083
(http://support.microsoft.com/kb/179083/EN-US/
)
HOWTO: Read Address Book Properties in Visual Basic
178787
(http://support.microsoft.com/kb/178787/EN-US/
)
HOWTO: Work with Distribution Lists Using CDO from VB
Displaying an Address Book Dialog BoxThe Outlook 98 object model does not support displaying a dialog for a user to select recipients from an address book. To implement an address book dialog in your solution, use the appropriate method.Method 1The preferred method of displaying an address book dialog is to use the AddressBook method in the CDO object model. Typically, you would add a Command Button control to the Outlook form and in the Click event for the button you would automate the CDO object model from Visual Basic Scripting Edition (VBScript).An advantage of using CDO to display the Address Book is that you can customize the appearance of the dialog box to suit your needs. For more information about using CDO to display the Address Book dialog box, consult the CDO documentation at the following Microsoft World Wide Web site: http://msdn.microsoft.com/
(http://msdn.microsoft.com/)
The AddressBook method documentation is located at the following Microsoft
World Wide Web site:
http://premium.microsoft.com/msdn/library/psdk/cdo/oleobjis_8dri.htm
(http://premium.microsoft.com/msdn/library/psdk/cdo/oleobjis_8dri.htm)
Method 2Use a command button control on an Outlook form that is bound to a recipient field (such as the "To" field). If a command button is bound to a recipient field, when the user clicks the button, Outlook displays the address book dialog box and the recipient that the user selects is added the field.NOTE: Although Outlook items other than a mail message do not have recipients fields, these fields are functional on non-mail forms even though they are not listed in the set of fields available for that particular item. You cannot directly access these fields from VBScript, because the Outlook object model does not consider these to be valid properties of items that are not MailItems. However, as the steps that follow illustrate, you can "filter" the data through another valid field to access the user's selection from VBScript. Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact a Microsoft Certified Partner or Microsoft Advisory Services. For more information, visit these Microsoft Web sites: Microsoft Certified Partners - https://partner.microsoft.com/global/30000104 (https://partner.microsoft.com/global/30000104) Microsoft Advisory Services - http://support.microsoft.com/gp/advisoryservice (http://support.microsoft.com/gp/advisoryservice) For more information about the support options that are available and about how to contact Microsoft, visit the following Microsoft Web site:http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS (http://support.microsoft.com/default.aspx?scid=fh;en-us;cntactms) The following steps illustrate how to set up a command button on an Outlook Contact form that displays the address book dialog box. This approach works on form types other than a contact form.
NOTE: It is not possible to change any of the labels or strings in this Address Book dialog box, as you can with the dialog box created using CDO. REFERENCES
For more information about creating solutions with Microsoft Outlook 98,
please see the following articles in the Microsoft Knowledge Base:
180826
(http://support.microsoft.com/kb/180826/EN-US/
)
OL98: Resources for Custom Forms and Programming
182349
(http://support.microsoft.com/kb/182349/EN-US/
)
OL98: Questions About Custom Forms and Outlook Solutions
| Article Translations
|

Back to the top
