I work on a VSTO in c#. When I click on button I save attachment in a folder. My problem is : when I have a rich email with an image in the signature, I have a element in my
We had a need to show only the "Mail Attachments" (not the embedded ones that are used for rendering) in an Outlook Add - In, and this is what that works.
if (mailItem.Attachments.Count > 0)
{
// get attachments
foreach (Attachment attachment in mailItem.Attachments)
{
var flags = attachment.PropertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x37140003");
//To ignore embedded attachments -
if (flags != 4)
{
// As per present understanding - If rtF mail attachment comes here - and the embeded image is treated as attachment then Type value is 6 and ignore it
if ((int)attachment.Type != 6)
{
MailAttachment mailAttachment = new MailAttachment { Name = attachment.FileName };
mail.Attachments.Add(mailAttachment);
}
}
}
}