Message Object (CDONTS Library)

The Message object represents a single message, item, document, or form in a folder.

At a Glance

Specified in type library: CDONTS.DLL
First available in: CDO for NTS Library version 1.2
Parent objects: Messages collection
Child objects: Attachments collection
Recipients collection
Default property: Subject

No modifications are permitted to messages in the Inbox, except for message deletion. Therefore, all properties on a Message object are treated as read-only when the message is in the Inbox. When the access is described as read/write in the following table, that access applies only to messages in the Outbox.

Properties


Name
Available since version
Type

Access
Application 1.2 String Read-only
Attachments 1.2 Attachment object or Attachments collection object Read-only
Class 1.2 Long Read-only
ContentBase 1.2 String Read/write
ContentID 1.2 String Read-only
ContentLocation 1.2 String Read/write
HTMLText 1.2 IStream object or String Read/write
Importance 1.2 Long Read/write
MessageFormat 1.2 Long Write-only
Parent 1.2 Messages collection object Read-only
Recipients 1.2 Recipient object or Recipients collection object Read-only
Sender 1.2 AddressEntry object Read-only
Session 1.2 Session object Read-only
Size 1.2 Long Read-only
Subject 1.2 String Read/write
Text 1.2 IStream object or String Read/write
TimeReceived 1.2 Variant (vbDate format) Read-only
TimeSent 1.2 Variant (vbDate format) Read-only

Methods


Name
Available since version
Parameters
Delete 1.2 (none)
Send 1.2 (none)

Remarks

Microsoft?Visual Basic?programmers can create new Message objects using the Messages collection's Add method.

A message can be obtained from its parent Messages collection using the collection's Item property. To get to the Messages collection in a folder, use the Folder object's Messages property.

The CDO for NTS Library does not permit any modifications to messages in the Inbox, other than deleting the entire message. Prohibited modifications include adding, deleting, or changing any attachment; adding, deleting, or changing any recipient; and writing to any message property, even one with read/write access.