Get the CID from Attachment Filename

C

chris

I am trying to determine if one of my attachments from an Outlook
message is an embedded Image in the HTML Body of this message.

I am using the Outlook Object Model and I have a component that
extracts the CDO Properties of any message that I pass it.

I basically extract the HTMLBody of the message, then iterate through
each of the attachments and look to see if this attachment is part of
the HTMLBody of the message.

If it is I leave it alone. If Not I extract the Attachment. - this is
the key as I am ultimately trying to extract the Items that are NOT in
the HTML

I have so far determined that I can look for a number of things in the
HTML Body such as:

src="cid:filename.gif",
<IMG SRC=Filename.gif ....
src="http://....../Filename.gif"

BUT when I have an attached file whose name is "boomerang.gif" for
example, and I look at the HTMLBody to see if it exists, I do not find
a match!!

Instead I notice that I have this:

background=cid:939452716@06042005-1C1A

Where 939452716@06042005-1C1A should be "boomerang.gif"?!?!

I am also aware that the internet header of the message can sometimes
contain Information about the embedded images (Content-Type and
Content-ID), but in my case I have an email that has no Header.

Can anyone help me on this?

Ideally I would like to take the Filename of the attachment and
discover if the Message has a content ID for it.

HELP!!

Thanks
 
K

Ken Slovak - [MVP - Outlook]

The original HTML can be rewritten by Outlook. The worst if you actually
study the HTML is if a message is part of a thread and the messages going
back and forth are moving between the Outlook editor and WordMail. That's a
real mess.

If you open the attachments table and look at each attachment you can see
how it was attached from the PR_ATTACH_METHOD property (PT_LONG,
0x37050003).

ATTACH_BY_VALUE = 1, etc. Same values as the Attachment.Type value you get
from the Outlook object model. Avoid olEmbeddeditem (5).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top