RDOAttachments object collection |
RDOAttachments collection represents the attachments of a message.
Returned by: RDOMail.Attachments
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 attachment names.
set Session = CreateObject("Redemption.RDOSession") |
Derived from: IDispatch |
|||
|
|||
Properties |
|||
|
|||
Count |
integer. Returns the number of attachments in the collection
|
|
|
_Item(Index) |
Index - integer. A default object property. Retrieves an attachment with a given index (1 to Count). Returns RDOAttachment object
|
|
|
RawTable |
IUnknown, read-only. Returns the IMAPITable Extended MAPI interface (as returned by IMessage::GetAttachmentTable in Extended MAPI) used internally by the RDOAttachments 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 attachment with a given index (1 to Count). Returns RDOAttachment object |
set Session =
CreateObject("Redemption.RDOSession")
|
|
Add(Source, Type, Position, DisplayName) |
Adds a new attachment. Returns RDOAttachment object.
Source - either a string specifying the fully qualified path to the file to be attached, a message (RDOMail object), an attachment from another message (RDOAttachment object), or a variant array of bytes (assumed to be the raw attachment data). If Source is a string, an error will be raised if the file does not exist or cannot be accessed.
Type - integer, optional. One of the OlAttachmentType enums - olByValue (1), olByReference (4), olEmbeddeditem (5)
Position - integer, optional. Position of the attachment in the message body. Only applies to the messages in the RTF format.
DisplayName - string, optional. Attachment display name. Warning - as of Outlook 2002 SP3, Outlook always displays the file name instead of display name for security reasons.
|
set Session =
CreateObject("Redemption.RDOSession") 'add a message 'add a file 'add a variant array of bytes - create a TXT file attachment with "test" inside Dim
AttachData(3)
'all done, save the message
|
|
Remove(Index) |
Removes an attachment with an index given by the Index parameter (integer, 1 through Count).
|
|
|
Clear |
Removes all attachments from the message
|
|
|
GetFirst |
Returns the first attachment in the collection. Returns Nothing if no first attachment exists, for example, if there are no attachments.
|
|
|
GetLast |
Returns the last attachment in the collection. Returns Nothing if no last attachment exists, for example, if there are no attachments.
|
|
|
GetNext |
Returns the next attachment in the collection. It returns Nothing if no next attachment exists, for example, if already positioned at the end of the collection.
|
|
|
GetPrevious |
Returns the previous attachment in the collection. It returns Nothing if no previous attachment exists, for example, if already positioned at the beginning of the collection.
|
|