Name Property (Attachment Object)

The Name property returns or sets the display name of the Attachment object as a string. Read/write.

Syntax

objAttachment.Name

The Name property is the default property of an Attachment object, meaning that objAttachment is syntactically equivalent to objAttachment.Name in Microsoft® Visual Basic® code.

Data Type

String

Remarks

The Name property can also be set at the time of creation of the attachment by supplying the name parameter to the Add method of the Attachments collection.

If the attachment's name is not supplied at creation time and is not set subsequently, Name returns the following values depending on the setting of the attachment's Type property:

Attachment Type property Attachment Name property if never set
CdoFileData The file name from the attachment's Source property
CdoFileLink The file name from the attachment's Source property
CdoOLE An empty string
CdoEmbeddedMessage An empty string

The Name property corresponds to the MAPI property PR_DISPLAY_NAME. It can be rendered into HTML hypertext using the CDO Rendering ObjectRenderer object. To specify this, set the object renderer's DataSource property to this Attachment object and the property parameter of the RenderProperty method to CdoPR_DISPLAY_NAME.

Example

See the example for the Attachment object's Index property.