How to find out a relation between the embedded images and the attachment collection of an email

  • Thread starter Thread starter DPM
  • Start date Start date
D

DPM

Hi,

When an email is created from MS Outlook with an embedded image(Inserted a
picture from a file/clipart) the image tag is as,

eg.
<img width=836 height=395 id="_x0000_i1025"
src="cid:[email protected]">

and the could figure out which attachment is linked from the attachment
collection with the file name.
(eg. Attachment collection will also have "image01.jpg")

But when the email created from Outlook Express and received from MS Outlook
the image tag will be as follows,

eg.
<img width=836 height=395 id="_x0000_i1025"
[email protected]>

The attachment collection does not have this random name but has the actual
file name. Therefore cannot identify which attachment is linked.
But when the mail is viewed in MS Outlook it somehow figures out the correct
image.

Could someone please advise on how get a reference to the attachment for
such embedded images.
 
That happens not only with OE but in a thread of messages exchanged using
only Outlook on both ends. It gets even worse if one user has WordMail
enabled and the other user doesn't.

You'd have to get each attachment in the attachment table and look for the
PR_ATTACH_CONTENT_ID property and read that string (PT_STRING8) property to
get the cid for that attachment.

That property isn't exposed in the Outlook object model except for Outlook
2007 if you use the PropertyAccessor on the Attachment object where you'd
use a property tag of "urn:schemas:mailheader:content-id" for it.

In MAPI terms, if you were to use CDO 1.21 or Extended MAPI or a MAPI
wrapper such as Redemption (www.dimastr.com/redemption) you could use a
property tag of 0x3712001E (&H3712001E for VB/VBA).
 
I'm not sure if there is. You might want to look around at the samples on
the Redemption Web site to see if any use that property tag or similar ones.
 
Thank you. I tried reading the properties using Redemtion and it works fine for Outlook 2003 and 2007.

Regards,
Silas.
 
Back
Top