SaveAsFile Method

Applies To

Attachment object.

Description

Saves the attachment to the specified path.

Syntax

expression.SaveAsFile(Path)

expression An expression that returns an Attachment object.

Path Required String. The location to save the attachment.

Example

This example saves the first attachment of the currently open item as a file in the My Documents folder, using the attachment's display name as the file name.

Set myItem = myOlApp.ActiveInspector.CurrentItem
Set myAttachments = myItem.Attachments
myAttachments.Item(1).SaveAsFile "C:\My Documents\" & _
    myAttachments.Item(1).DisplayName