Java Programming Examples

Exchange Server 2003

Topic Last Modified: 2004-06-09

This section presents code illustrating Java access to the CDO Library and the CDO Rendering Library. Each example accomplishes a task your program might perform when dealing with CDO library objects.

The following table summarizes the programming procedures used in the examples. Note that all tasks require creation of a valid session and a successful logon.

Programming task

Procedure

Logging On and Off

1. Create a session.

2. Log on.

3. Log off.

Creating and Sending a Message

1. Create a session.

2. Log on.

3. Get the Outbox Messages collection.

4. Add a new message.

5. Populate the new message.

6. Send the new message.

7. Log off.

It is important to understand the object hierarchies of the CDO libraries, because they determine the correct syntax of Java statements. The relative positioning of the objects within the hierarchies determines the order in which the objects should be accessed. For more information on the hierarchies, see Object Model and Rendering Object Model.

To access the CDO Library, a Java program should import CDO.DLL on 32-bit platforms. To access the CDO Rendering Library, import CDOHTML.DLL on 32-bit platforms. Neither library is available on 16-bit platforms.

Show: