Name Property (Attachment Object)

Name Property (Attachment Object)

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



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



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


The file name from the attachment's Source property


The file name from the attachment's Source property


An empty string


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.


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

See Also


Attachment Object