|
|
RDORecipients object collection |
RDORecipients collection represents
the recipients of a message.
Returned by:
RDOMail.Recipients,
ReplyRecipients
RDOAddressBook.ShowAddressBook
The example below connects to the
MAPI session used by Outlook, retrieves a message using the entry id of a give
Outlook Object Model message, and prints out all the recipient names.
|
set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Application.Session.MAPIOBJECT
set Mail = Session.GetMessageFromID(MailItem.EntryID)
for each Recip in Mail.Recipients
debug.print Recip.Name
next |
|
Derived from:
IDispatch
|
|
Properties |
|
|
Count |
integer. Returns the number
of recipients in the recipients collection
|
|
|
_Item(Index) |
Index -
integer. A default object property.
Retrieves an recipient with a
given index (1 to Count).
Returns
RDORecipient object
|
|
|
RawTable |
IUnknown, read-only. Returns the IMAPITable Extended MAPI interface
(as returned by IMessage::GetRecipientTable in Extended MAPI) used
internally by the RDORecipients collection
|
|
|
Session |
RDOSession, read-only. Returns the parent
MAPI session represented by the RDOSession object
|
|
|
MAPITable |
MAPITable, read-only. Returns the
MAPITable Redemption object which can be used to manipulate the
collection (restrict, find, etc).
|
|
|
Parent |
Returns the parent
RDOMail object
|
|
|
Methods |
|
|
Item(Index) |
Index -
integer.
Retrieves an recipient with a
given index (1 to Count).
Returns
RDORecipient object |
|
|
Add(Source) |
Adds a new recipient. Returns
RDORecipient object.
Source - either a
string (name or e-mail address) or RDORecipient or
RDOAddressEntry object.
New in version 5.2: RDOContactItem or an
RDODistListItem object (or event
ContactItem or
DistListItem
from Outlook). |
set Session =
CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Application.Session.MAPIOBJECT
set Inbox = Session.GetDefaultFolder(olFolderInbox)
set Msg = Inbox.Items.Add
set Recip = Msg.Recipients.Add("Joe User")
Recip.Type = olCC
Recip.Resolve
|
|
AddEx(Name,
Address, AddressType, Type) |
Adds a new recipient. Returns
RDORecipient object.
Unlike the Add() method,
AddEx allows to add a recipient and resolve it in a single call; if all
4 parameters are specified, Redemption creates a recipient with a
one-off entry id.
Name - string,
recipient name
Address - string,
recipient address
Address - string,
address type (e.g. "SMTP")
Type - integer,
recipient type (olTo, olCC, olBCC)
|
set Session =
CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Application.Session.MAPIOBJECT
set Inbox = Session.GetDefaultFolder(olFolderInbox)
set Msg = Inbox.Items.Add
Msg.Recipients.AddEx("Dmitry", "dmitry@dimastr.com", "SMTP", olTo)
Msg.Recipients.ResolveAll |
|
Remove(Index) |
Removes an recipient with an
index given by the Index parameter (integer, 1 through Count).
|
|
|
Clear |
Removes all recipients from
the message |
|
|
ResolveAll(ShowDialog,
ParentWndHandle) |
Resolves all message
recipients. Resolves TRUE if successful.
ShowDialog - boolean,
optional. If true and some recipients cannot be resolved or are
ambiguous, displays the name resolution dialog.
ParentWndHandle -
integer, optional. The window handle to be eused as teh parent of the
name resolution dialog. |
set Session =
CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Application.Session.MAPIOBJECT
set Inbox = Session.GetDefaultFolder(olFolderInbox)
set Msg = Inbox.Items.Add
Msg.To = "dmitry@dimastr.com; outspy@dimastr.com"
Msg.Recipients.ResolveAll |
|