MailRecipients Object
The MailRecipients object represents a collection of recipients of an email message. The MailRecipients object is available to the current Briefcase object.
MailRecipients Object Properties
The MailRecipients object provides the following properties, all of which are read-only. To affect some read-only properties requires user interaction or custom event procedures.
Count Property
The total number of message recipients. Read-only.
Syntax
Count As Long
Recipient Property
An object that represents the individual recipient specified by Index.
Syntax
Recipient(Index) As IASMailRecipient
MailRecipients Object Methods
The MailRecipients object methods affect the current MailRecipients object. They are described below.
Add Method
Adds a recipient to the current MailRecipients collection.
Syntax
Add(Address As String, [Type As AS_MAPIMSG_RECIP_TYPE = AS_MMRT_TO], [Name As String]) As IASMailRecipient
| Name | Description |
|---|---|
|
Address |
The email address of the recipient to add. |
|
Type |
The type of recipient as one of the AS_MAPIMSG_RECIP_TYPE constants. |
|
Name |
The name of the recipient to add. |
Return Value
A MailRecipient object.
Remarks
The Name parameter should be used to specify the recipient's email address and an empty string passed to the Address parameter. If an email address is specified in Name, it must be surrounded with carets (<>). When used with Microsoft Outlook, Name parameter may contain the user's full name or last name and Outlook will attempt to resolve the name to the email address in the default address book.
Examples
oMessage.Recipients.Add “” ,AS_MMRT_TO, “<” + Document.EmailAddress + “>”
oMessage.Recipients.Add “” ,AS_MMRT_TO, “User Full Name” + “<” + Document.EmailAddress + “>”
oMessage.Recipients.Add “” ,AS_MMRT_TO, “User Last Name”
Remove Method
Removes a recipient from the current MailRecipients object.
Syntax
Remove(Index)
| Name | Description |
|---|---|
|
Index |
The recipient in the MailRecipients collection specified by Index. Read-only. |
RemoveAll Method
Removes all recipients from the current MailRecipients collection.
Syntax
RemoveAll()
Parameters
This method accepts no parameters.