A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook - General Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Get the CID from Attachment Filename



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old February 22nd 06, 07:44 PM posted to microsoft.public.outlook
chris
external usenet poster
 
Posts: 9
Default Get the CID from Attachment Filename

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

  #2  
Old February 23rd 06, 02:56 PM posted to microsoft.public.outlook
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Get the CID from Attachment Filename

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).

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"chris" wrote in message
oups.com...
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


  #3  
Old February 27th 06, 07:33 PM posted to microsoft.public.outlook
chris
external usenet poster
 
Posts: 9
Default Get the CID from Attachment Filename

Thanks Ken, I will give this a go and let you know how it works out
regards,

Chris

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Attachment not available Stephen Yang Outlook - General Queries 0 January 11th 06 12:12 AM


All times are GMT +1. The time now is 05:29 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.