Attachments Object
The Attachments object is a property of the MailMessage and NewMailMessage objects that is used to manage the file attachments of email messages.
Attachments Object Properties
The Attachments object provides the properties described below.
Attachment Property
An object that represents an attachment to the message. Read-only.
Syntax
Attachment(Index) As IASMailAttachment
Count Property
Total number of attachments to the message. Read-only.
Syntax
Count As Long
Attachments Object Methods
The Attachments object provides the methods described below.
Add Method
Adds an attachment to the current NewMailMessage object.
Syntax
Add(FilePath As String, [Name As String])
| Name | Description |
|---|---|
|
FilePath |
The path of the file to attach to the current NewMailMessage object. |
|
Name |
Optional name of the attachment. |
Return Value
An Attachment object.
Remove Method
Removes an attachment from the current NewMailMessage object.
Syntax
Remove(Index)
| Name | Description |
|---|---|
|
Index |
A specific item in the attachments collection. Read-only. |
RemoveAll Method
Removes all attachments from the current NewMailMessage object.
Syntax
RemoveAll()
Parameters
This method accepts no parameters.