How to delete the particular attachment in outlook

Hi sir



From your post i take this lines

“MapiMessage.RemoveAttachments(“c:\temp\outlookmessage.msg”)”
"MapiMessage.DestroyAttachments(“c:\temp\outlookmessage.msg”)"
in this it delete the all attachment.


NOTE
In my email i have 4 attachment i want to delete 2 & 4th attachmetn remaining attachment i want to save as .msg format

Hi Senthil,

Thank you for writing to Aspose support team.
You may please use following sample code to remove required attachments from the MapiMessage and let us know the feedback.

var message = MapiMessage.FromFile(@"C:\temp\SampleMessage.msg");
var attachments = message.Attachments;
MapiAttachment att1 = attachments[1];
MapiAttachment att2 = attachments[3];
attachments.Remove(att1);
attachments.Remove(att2);
message.Save("C:\\temp\\out.msg");