Share via


Enabling a Folder for Mail

Enabling a Folder for Mail

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.

Example

This example enables a folder (mailbox) for receiving mail.

Visual Basic

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.

Sub EnableFolder(DomainName As String, _
                 FolderName As String)

    'DomainName is something like "MyDomain.wherever.com"
    'FolderName is something like "Public Folders/Folder3"

    Dim objFolder As New CDO.Folder
    Dim objRecip As CDOEXM.IMailRecipient
    Dim fullurl As String

    'fullurl might look like:
    ' "file://./backofficestorage/MyDomain.wherever.com/Public Folders/Folder3"
    fullurl = "file://./backofficestorage/" + _
              DomainName + "/" + FolderName

    objFolder.DataSource.Open fullurl, , adModeReadWrite, adFailIfNotExists
    Set objRecip = objFolder
    objRecip.MailEnable
    objFolder.DataSource.Save

End Sub

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.