CDO for NTS Object Usage

CDO for NTS Object Usage

Exchange Server 2003

Topic Last Modified: 2004-06-09

The CDO for NTS objectsare described in the remainder of this section. The following table summarizes the objects in alphabetic order and gives the principal function of each one.




Specify addressing information for an individual messaging user.


Associate an additional object with a message.

Attachments collection

Access all attachments on a message; create new attachments.


Open the default Inbox or Outbox folder in a message store.


Compose, populate, send, and receive an e-mail document.

Messages collection

Access all messages in a folder; create new messages.


Send a message without having to log on to a session.


Specify information for a messaging user intended to receive a message.

Recipients collection

Access all recipients of a message; create new recipients.


Establish a connection between an application and a messaging system.

All these objects can be declared using Object for their data type, but it is preferable to take advantage of early binding, to enforce type checking and generate more efficient code:

  Dim objMsg As Message ' in preference to Dim As Object
  Dim colAtts As Attachments

You can also use an object's full type name in order to distinguish it from identically named objects available to a Visual Basic program through other object libraries such as the CDO Library:

  Dim objSess As CDONTS.Session ' distinguished from MAPI.Session
  Dim colRecips As CDONTS.Recipients
© 2015 Microsoft