Share via


Accessing Mailboxes and Folders

Accessing Mailboxes and Folders

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

When managing recipients, the CDO for Exchange Management (CDOEXM) recipient interfaces access and modify items in both Microsoft® Active Directory® and Microsoft Exchange Server 2003.

For more information about the use of Active Directory in Exchange, see Active Directory and CDOEXM.

Person and User Objects Use LDAP

Recipients are defined in both Active Directory and Exchange Server 2003. The principal location to bind to a recipient is in Active Directory. Thus, the CDOEXM interfaces in the Person and User objects bind to Active Directory by using an LDAP URL. The following example illustrates this:

Dim objPerson As New CDO.Person
objPerson.DataSource.Open
"LDAP://MYSERVER1/CN=jamessmith,CN=users,
DC=CompanyADomain,DC=Dev,DC=com"

The LDAP URL consists of the following parts:

"LDAP://servername/CN=RecipientName,CN=container,CN=container2,CN=containerN,
DC=DomainNamePart,DC=DomainNamePart2,DC=DomainNamePartn"

For related information, see Building Active Directory Paths.

Folder Objects Use ExOLEDB

Note  The following example uses a file URL with the Exchange OLE DB (ExOLEDB) provider. The ExOLEDB provider also supports The HTTP: URL Scheme. Using The HTTP: URL Scheme allows both client and server applications to use a single URL scheme.

To use CDOEXM interfaces in the Folder object, you connect directly to a store by using the ExOLEDB provider. Connect to the store by providing a "File://./" URL. An Open statement might look like the following:

Dim objFolder As New CDO.Folder
fullurl = "file://./backofficestorage/MyDomain.wherever.com/Public Folders/Folder3"
objFolder.DataSource.Open fullurl, , adModeReadWrite, adFailIfNotExists

The File URL parts are defined as follows:

 fullurl = "file://./backofficestorage/DomainName/FolderName"

For an example of working with a folder, see Building a Restricted Address List.

Send us your feedback about the Microsoft Exchange Server 2003 SDK.

Build: June 2007 (2007.618.1)

© 2003-2006 Microsoft Corporation. All rights reserved. Terms of use.