Attachment object

 

Attachment object represents a message attachment.

 

Returned by:

Attachments.Add

Attachments.Item

 

Properties

Methods

 


Derived from: IDispatch


Properties


Application Returns Outlook.Application object
 
AsArray

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

 

 
AsText

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

 

 
Class: Always returns 5 (olAttachment).
 
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.

 

 
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.

 

 
EmbeddedMsg

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

 

 

 
Fields[PropTag]

Returns or sets an Extended MAPI property

PropTag -  integer Extended MAPI property tag (e.g. 0x0037001E for PR_SUBJECT_A)

Note that RDO family of objects also supports accessing MAPI properties by a DASL property name.

 

You can use one of the MAPITags enumeration elements, e.g. MAPITags.PR_SUBJECT.

Scalar properties are returned as variants of the corresponding type (e.g. PT_STRING8 and PT_UNICODE properties are returned as strings, PT_LONG as integers, etc).

For the object properties (PT_OBJECT, such as PR_CONTAINER_CONTENTS, PR_ACL_TABLE, etc) Redemption tries to open them as IMAPITable Extended MAPI object and, if successful, returns an instance of the Redemption.MAPITable object

 

 
FileName String, read-write. File name of the attachment
 
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.
 
Index Integer, read-only. The index of the attachment.
 
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.

 

 
MAPIOBJECT

Unknown, read-only.

Returns the Extended MAPI object used internally by the RDO object; e.g. IMessage for the RDOMailObject, IMailUser for RDOAddressEntry, etc.

 

 
OleStorage

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

 

Parent Parent object, read-only.
 
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.

 

 
Session Returns Outlook.Namespace object.
 
Size

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

 

 
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)

 

 

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.