Extract an attached file from the current message.
Syntax
object.ExtractFile( FileName,
[MessagePart] )
Parameters
- FileName
- A string which specifies the name of the file that the
attachment will be written to. If the file does not exist, it will
be created. If the file exists, it will be overwritten.
- MessagePart
- An optional integer value that specifies the message part that
contains the file attachment.
Return Value
A value of zero is returned if the method succeeds.
Otherwise, a non-zero error code is returned which indicates the
cause of the failure.
Remarks
The ExtractFile method writes the contents of a message
part, typically a file attachment, to a file on the local system.
This method will automatically decode any binary file
attachments. If the optional MessagePart argument is not
specified, the current message part is used. To determine if the
current message part contains an attachment and to determine its
file name, check the value of the Attachment property.
An error will be returned if the specified message part does not
contain a file attachment.
To search for a file attachment in the current message with a
specific file name, use the FindAttachment method.
See Also
Attachment Property,
ExportMessage Method,
ExtractAllFiles Method,
FindAttachment Method
|