Question

I have an Outlook email and i need to process it's attachments. But when iterating thru the attachments, if the attachment is a signature i want to skip it.

To know if the attachment is a signature i am using:

outlookMailItem.Attachments[i].PropertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x3712001E");

But i am getting an Outlook security alert.

Is there another way using a safer code? Can it be done using Redemption?

Thank you for your time.

Was it helpful?

Solution

PR_ATTACH_CONTENT_ID property is a good indication that an attachment is an embedded image, but there are attachments that have PR_ATTACH_CONTENT_ID property set, but they are not embedded images (Lotus Notes likes to set PR_ATTACH_CONTENT_ID on all attachments). Even if PR_ATTACH_CONTENT_ID is not set, Outlook can use PR_ATTACH_CONTENT_LOCATION or PR_ATTACH_LONG_FILENAME to load an embedded image. The only real test is to parse the HTML body and figure out which <img> tags refer to the attachments. Redemption will let you access that property using RDOAttachment.Fields, you can also use RDOAttachment.Hidden property, which jumps through a few hoops to figure out whether an attachment is an embedded image and not a "real" attachment.

OTHER TIPS

RDOAttachment.Hidden property works well only if the email format is HTML. For emails in Rich Text Format, the signature image would be treated as any other attachment and will have this value as false. A better bet would be to use "Attachment.Type", which works for both HTML and Rich Text. For signature, it would always be olOLE and for other attachments, it would be olByValue. So, you can filter the signature images using this property. However, note that, if the email format is Rich Text and if you have a screenshot embedded within the email, it's treated as olOLE type.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top