vbMAPI Outlook/MAPI Code Library
(v1.16.0)

ref: vbMAPI_Attachment

On this page you'll find:

Overview

Equivalent MAPI object: IAttach
Equivalent Outlook Redemption object: Redemption.RDOAttachment
Equivalent Outlook Object Model object: OutlookAttachment
Parent: vbMAPI_Attachments

Class Description

This object represents an attachment of a message.


Property Get Properties() As vbMAPI_Properties

Exposes a collection of the MAPI properties set on this attachment.  The default member of the vbMAPI_Properties class is Item, therefore in VB you can call vbMAPI_Attachment.Properties(PropTag) directly.

Property Get NamedProperties(ByVal PropertySetGUID As String, _
              ByVal ID As Variant, _
              ByVal DataType As EnumMAPIPropDataTypes) As vbMAPI_Property

Provides access to MAPI named properties for this attachment.

PropertySetGUID: A string representation of the property set GUID (e.g. )
ID: The name (string) or property identifier (integer) representing the property to query from the property set.
DataType: The MAPI data type of the property.

Property Get AttachmentNumber() As Long

Returns the value of MAPI property PR_ATTACH_NUM for this attachment.

Property Get DisplayName() As String

Property Let DisplayName(ByVal Value As String)

Returns/sets the value of MAPI property PR_DISPLAY_NAME for this attachment.

Property Get FileName() As String

Property Let FileName(ByVal Value As String)

Returns/sets the value of MAPI property PR_ATTACH_LONG_FILENAME for this attachment.

Property Get Hidden() As Boolean

Property Let Hidden(ByVal RetVal As Boolean)

Returns/sets the value of MAPI property PR_ATTACHMENT_HIDDEN for this attachment.

Property Get PathName() As String

Returns the value of MAPI property PR_ATTACH_PATHNAME for this attachment.

Property Get Position() As Long

Property Let Position(ByVal RetVal As Long)

Returns/sets the value of MAPI property PR_RENDERING_POSITION for this attachment.

Property Get Size() As Long

Returns the value of MAPI property PR_ATTACH_SIZE for this attachment.

Property Get Type() As Long

Returns the value of MAPI property PR_ATTACH_METHOD for this attachment.

Property Get CreationTime() As Double

Returns the value of MAPI property PR_CREATION_TIME for this attachment.

Property Get LastModificationTime() As Double

Returns the value of MAPI property PR_LAST_MODIFICATION_TIME for this attachment.

Property Get ContentID() As String

Property Let ContentID(ByVal RetVal As String)

Returns/sets the value of MAPI property PR_ATTACH_CONTENT_ID for this attachment.

Property Get ContentMIMEType() As String

Property Let ContentMIMEType(ByVal RetVal As String)

Returns/sets the value of MAPI property PR_ATTACH_MIME_TAG for this attachment.

Property Get ContentLocation() As String

Property Let ContentLocation(ByVal RetVal As String)

Returns/sets the value of MAPI property PR_ATTACH_CONTENT_LOCATION for this attachment.

Property Get IsContactPhoto() As Boolean

Property Let IsContactPhoto(ByVal RetVal As Boolean)

Returns/sets the value of MAPI property PR_ATTACHMENT_CONTACTPHOTO for this attachment.

Property Get FileSize() As Long

Returns the size of the data stream for this attachment.

Sub SaveAsFile(ByVal FilePath As String)

Saves the data of this attachment out to a local file.

Property Get DataAsStream() As Variant

Returns an IStream interface for low-level access to the data of this attachment.

Property Get DataAsText() As String

Property Let DataAsText(ByVal Data As String)

Returns or sets the data of this attachment as a String value (byte array, raw data).

Property Get DataAsTextAnsi() As String

Property Let DataAsTextAnsi(ByVal Data As String)

Returns or sets the data of this attachment as a String value (raw data upsized to/from UNICODE).

Property Get Session() As vbMAPI_Session

Returns the session object associated with this object.

Property Get EmbeddedMessage() As vbMAPI_MailItem

Returns a vbMAPI_MailItem object that represents an embedded attachment.

Property Get MAPIOBJECT() As Variant

Returns the IAttach object associated with this item.

Sub Delete()

No information available at this time.


Enumeration description: EnumAttachmentMethod


AttachmentMethod_ByValue = &H1
AttachmentMethod_ByReference = &H4
AttachmentMethod_Embedded = &H5
AttachmentMethod_OLE = &H6