RDOAttachment object

 

RDOAttachment object represents a message attachment.

 

Returned by:

RDOAttachments.Item, Add

 

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")
Session.MAPIOBJECT = Application.Session.MAPIOBJECT
set Mail = Session.GetMessageFromID(MailItem.EntryID)
for each att in Mail.Attachments
  debug.print att.filename
next

 


Derived from: _MAPIProp -


_MAPIProp methods and properties: GetIDsFromNames, Fields(), GetPropList, GetNamesFromIDs, CopyTo, Save, MAPIOBJECT, Session


Properties


Parent

RDOMail, read-only. Returns the parent message of the attachment

 

 

DisplayName

String, read-write. Display name of the attachment.

Warning: as of Outlook 2002 SP3, Outlook does not use the attachment display name, it always displays the file name for the security reason.

 

 

FileName

String, read-write. File name of the attachment.

 

 

PathName

String, read-write. Attachment file path. Only valid for the attachments added by reference.

 

 

Position

Integer, read-write. Attachment position in the message body. Only valid for the messages in the RTF format.

 

 

Type

Integer, read-only. Returns an rdoAttachmentType constant indicating the type of the attachment. Can be one of these rdoAttachmentType constants.
olByReference (4)
olByValue (1)
olEmbeddeditem (5)
olOLE (6)

olOneDrive(7)

 

 

AsText

String, read-write. Returns/sets the attachment data as a string

 

 

AsArray

Variant array, read-write. Returns/sets the attachment data as a variant array

 

 

AsStream IUnknown, read-only. Returns the attachment data as IStream COM interface. Only valid for the olByValue attachments.
 

Size

Integer, read-only. The size of the attachment. Corresponds to the PR_ATTACH_SIZE MAPI property.

 

 

FileSize

Integer, read-only. The size of the attachment file data. Unlike the Size property (which includes the file contents data plus the size of other properties, such as the file name), FileSize returns the size of the file data only.

 

 

EmbeddedMsg

RDOMail, read-only. Returns the embedded message. Only valid for the olEmbeddedItem attachments.

 

 

OleStorage

IUnknown, read-only. Returns the attachment data as IStorage COM interface. Only valid for the olOLE attachments.

 

 

Hidden

Boolean, read-write. Indicates whether Outlook will hide the attachment from the list of available attachments in the user interface.

 

 

CreationTime

Returns a Date indicating the creation time for the attachment. This property corresponds to the MAPI property PR_CREATION_TIME. Read-only.

 

Note that messages received from an SMTP server do not expose this property (Exchange messages are fine). In this case CreationTime property will return the creation time of the parent message.

 

 

LastModificationTime

Returns a Date indicating the last modification time for the attachment. This property corresponds to the MAPI property PR_LAST_MODIFICATION_TIME. Read-only.

 

Note that messages received from an SMTP server do not expose this property (Exchange messages are fine). In this case LastModificationTime property will return the last modification time of the parent message.

 

 

ContentLocation

 

String, read-write. Corresponds to the PR_ATTACH_CONTENT_LOCATION MAPI property.

 

 

ContentID

 

String, read-write. Corresponds to the PR_ATTACH_CONTENT_ID MAPI property.

 

 

MimeSequence

 

Integer, read/write. Corresponds to the PR_ATTACH_MIME_SEQUENCE MAPI property.

 

 

MimeTag

 

String, read-write. Corresponds to the PR_ATTACH_MIME_TAG MAPI property.

 

 


Methods


Delete

Deletes the attachment.

 

 

SaveAsFile(Path)

Saves the attachment to the file system.

Path - fully qualified file name. Only valid for the olByValue and olEmbeddeditem attachments.

For the olOLE attachments (representing an embedded OLE object), Redemption will extract file data from the IStorage attachment object for the Bitmap (BMP), Windows Meta File (WMF/EMF), Excel, Word, PowerPoint, WordPad, and Adobe PDF file formats.