MapiMessage.DestroyAttachments

MapiMessage.DestroyAttachments method

Removes all attachments from an MSG file and overwrites the file. The attachments are not read, which is faster than RemoveAttachments.

public static void DestroyAttachments(string path)
ParameterTypeDescription
pathStringThe path of the MSG file.

Exceptions

exceptioncondition
ArgumentNullExceptionpath is null.
ArgumentExceptionpath is empty.

Examples

This example removes the attachments of an MSG file without reading them.

[C#]

MapiMessage.DestroyAttachments(@"c:\messages\message.msg");

[Visual Basic]

MapiMessage.DestroyAttachments("c:\messages\message.msg")

See Also