This documentation is archived and is not being maintained.

Opening Contacts from the Exchange Store

EWS Managed API

Topic Last Modified: 2006-06-12

The Iperson.DataSource property returns the attached IDataSource interface. The IDataSource interface exposes two methods that may be used for opening contacts from the Exchange store: Open, and OpenObject.

The IDataSource.Open method may be called to bind to and open data from the item at the specified URL. The IDataSource.OpenObject is intended to allow you to open data easily from another object at run time, rather than from a particular store or database.

The following example shows how to open a contact from a user's contact folder within their mail account.

Visual Basic

'Declare variables
Dim iPer Ss New CDO.Person
Dim strURL As String

'Setup the URL for the contact in the mail users contact folder
strURL = "http://server.example.com/exchange/UserAlias/Contacts/JohnSmith.eml"

'Open the contact
iPer.DataSource.Open strURL

Show: