RemoveAttachments
MapiMessage.RemoveAttachments method
从指定的 Outlook 邮件文件中删除所有附件。
public static MapiAttachmentCollection RemoveAttachments(string path)
范围 | 类型 | 描述 |
---|---|---|
path | String | Outlook 邮件文件的名称。 |
返回值
附件集合。
例子
以下示例演示了如何销毁 Outlook 邮件文件中的附件。
[C#]
[视觉基础]
//从 Outlook 邮件文件中删除附件
MapiAttachmentCollection attachments = MapiMessage.RemoveAttachments(@"c:\outlookmessage.msg");
//附件
foreach(MapiAttachment att in attachments)
{
Console.WriteLine("Attachment Name:"+att.FileName);
att.Save(att.FileName);
}
'从 Outlook 邮件文件中删除附件
MapiAttachmentCollection attachments = MapiMessage.RemoveAttachments("c:\outlookmessage.msg");
'附件
For Each att As MapiAttachment In msg.Attachments
Console.WriteLine("Attachment Name:" + att.FileName)
att.Save(att.FileName)
Next
也可以看看
- class MapiAttachmentCollection
- class MapiMessage
- 命名空间 Aspose.Email.Mapi
- 部件 Aspose.Email