MAPI message attachments - embedded vs attached

I have a program that imports msg files and uses PR_HASATTACH to determine if there are attachments. (I need to set a boolean in a table if there are attachments or not.)

The problem is that if there is an embedded image (like a logo), that property is set to true.  Is there a way to determine the difference between embedded images and true attachments to the message?

I've also looked at PR_MESSAGE_ATTACHMENTS and that is also populated with embedded images/items, so that doesn't help me either.
bjones8888PresidentAsked:
Who is Participating?
 
bjones8888Connect With a Mentor PresidentAuthor Commented:
I found the solution.  Embedded images (or "inline" images) have a value set for the PR_ATTACH_CONTENT_ID or PR_ATTACH_CONTENT_ID_W property of the attachment.  So first I have to obtain the attachment collection, and read this property on each attachment.  If it has a value, then it is an inline or embedded image (its purpose is to tell the email client where in the message body to display the image).  If the value of that property is MAPI_E_NO_FOUND, then it is an attached item.
0
 
yarwellCommented:
As email is a text only medium surely any image is by definition an attachment ?
0
 
bjones8888PresidentAuthor Commented:
I found the answer myself.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.