Platform SDK: CDO 1.2.1

CDO for NTS Object Usage

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

Object Purpose
AddressEntry Specify addressing information for an individual messaging user.
Attachment Associate an additional object with a message.
Attachments collection Access all attachments on a message; create new attachments.
Folder Open the default Inbox or Outbox folder in a message store.
Message Compose, populate, send, and receive an e-mail document.
Messages collection Access all messages in a folder; create new messages.
NewMail Send a message without having to log on to a session.
Recipient Specify information for a messaging user intended to receive a message.
Recipients collection Access all recipients of a message; create new recipients.
Session 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