Attachment.GetTemporaryFilePath Method

Returns the full path to the attached file that is in a temporary-files folder. Read-only.

Namespace:  Microsoft.Office.Interop.Outlook
Assembly:  Microsoft.Office.Interop.Outlook (in Microsoft.Office.Interop.Outlook.dll)

Syntax

'Declaration
<DispIdAttribute()> _
Function GetTemporaryFilePath As String
'Usage
Dim instance As Attachment
Dim returnValue As String

returnValue = instance.GetTemporaryFilePath()
[DispIdAttribute()]
string GetTemporaryFilePath()

Return Value

Type: System.String
Returns a String that represents the full path to the temporary attachment file.

Remarks

The GetTemporaryFilePath method is only valid for those attachments whose Type property is olByValue. That means that the attachment is a copy and that the copy can be accessed even if the original file is removed. For other attachment types, the GetTemporaryFilePath method returns an error.

GetTemporaryFilePath also returns an error when accessing an Attachment object in an Attachments collection or in the AttachmentSelection object. Use GetTemporaryFilePath only in attachment event callbacks listed below for various Microsoft Outlook items:

  • AttachmentAdd

  • AttachmentRead

  • AttachmentRemove

  • BeforeAttachmentAdd

  • BeforeAttachmentPreview

  • BeforeAttachmentRead

  • BeforeAttachmentSave

  • BeforeAttachmentWriteToTempFile

See Also

Reference

Attachment Interface

Attachment Members

Microsoft.Office.Interop.Outlook Namespace