Attachments Collection
Parent object: Message object.
An object reference to an Attachments collection is returned from a call to the Attachments property of a Message object.
The Attachments collection is a child of a Message object and contains zero or more Attachment objects. Use the Attachments collection to add new Attachment objects to a message or to access the attachments that are already part of the current message. Table 15.6 and Table 15.7 list the properties and methods of the Attachments collection, respectively.
Table 15.6. Attachments Collection Properties
|
Property |
Description |
|---|---|
|
Count |
An integer value that represents the number of Attachment objects in the Attachments collection. This property is read-only. |
|
Item |
Returns a reference to a single Attachment object in the collection. This property is read-only. |
Table 15.7. Attachments Collection Methods
|
Method |
Description |
|---|---|
|
Add |
Adds an Attachment object to the Attachments collection. You can add Attachment objects to an Attachments collection only for a message you are sending. |
|
Delete |
Removes all the Attachment objects from the current Attachments collection. Be cautious when using the Delete method of the Attachments collection, since it deletes every Attachment object in the collection. To remove a single Attachment object from a collection, use the Delete method of the Attachment object. |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access