Platform SDK: Exchange 2000 Server

Creating a Contact in the Exchange Store

[This is preliminary documentation and subject to change.]

Creating a contact involves setting informational properties and saving the object to the Exchange store. This example uses an Exchange OLE DB Provider URL to save the object. For convenience, a comparable Internet Publishing OLE DB Provider URL is commented out.

Example

This example creates a Person contact.

[Visual Basic]
Dim oPerson As New CDO.Person
Dim strURL As String

oPerson.FirstName = "John"
oPerson.LastName = "Smith"
oPerson.HomeCity = "Redmond"
oPerson.HomeState = "Washington"
oPerson.Email = "jsmith@somewhere.microsoft.com"

'URL to save the contact using Exchange OLE DB Provider
strURL = "file://./backofficestorage/fullyqualifieddomain.Microsoft.Com/MBX/User1/Contacts/JohnSmith"

'if using Internet Publishing OLE DB Provider
'use this URL instead
'strURL = "http://servername/exchange/user1/contacts/JohnSmith"

'Save the contact
oPerson.DataSource.SaveTo strURL