Messages Property (CDONTS Folder Object)

The Messages property returns a Messages collection object within the folder. Read-only.

Syntax

objFolder.Messages 
 

The Messages property is the default property of a Folder object, meaning that objFolder is syntactically equivalent to objFolder.Messages in Microsoft® Visual Basic® code.

Data Type

Object (Messages collection)

Remarks

Although the Messages property itself is read-only, the collection it returns can be accessed in the normal manner through its Add and Delete methods, and the properties on its member Message objects retain their respective read/write or read-only accessibility.

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 modifying any attachment; adding, deleting, or modifying any recipient; and modifying any message property, even one with read/write access.

Example

This code fragment shows how a Messages collection of Message objects is obtained from a folder which is in turn obtained from a Session object:

Dim objInbox as Folder 
Dim collInMessages as Messages 
' assume valid Session object 
Set objInbox = objSession.GetDefaultFolder(CdoDefaultFolderInbox) 
Set collInMessages = objInbox.Messages 
 

© 1997 by Microsoft Corporation. All rights reserved.