Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Getting inline attachment cid

190 views
Skip to first unread message

Tomislav Petrovic

unread,
Jun 2, 2004, 5:49:29 AM6/2/04
to
I have a HTML mail message which contains inline images which are
attachments....
Html Body looks something like this (it was created in OE and sent to
Outlook):

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>

<META content="MSHTML 6.00.2800.1400" name=GENERATOR>
<STYLE>BODY {
MARGIN-TOP: 25px; FONT-SIZE: 12pt; MARGIN-LEFT: 25px; COLOR: #ff6633;
FONT-FAMILY: Arial, Helvetica
}
</STYLE>
</HEAD><FONT face=Arial><FONT size=2>
<BODY background=cid:001e01c4487b$239aeeb0$2803a8c0@TOMISLAV>
<DIV><IMG style="WIDTH: 800px; HEIGHT: 590px" alt="" hspace=0
src="cid:001c01c4487b$23987db0$2803a8c0@TOMISLAV" align=left border=0><FONT
color=#000000 size=2>Bla bla</FONT></DIV>
<DIV><IMG style="WIDTH: 572px; HEIGHT: 400px" alt="" hspace=0
src="cid:001d01c4487b$239aeeb0$2803a8c0@TOMISLAV" align=right
border=0></DIV></BODY></HTML>

All three images used I find in attachments....
But how can I know which attachment corresponds to which image?
Or in other words, how can I connect attachment with "cid:xxxxxxxxx"?

Tomy.


Dmitry Streblechenko (MVP)

unread,
Jun 2, 2004, 10:28:30 AM6/2/04
to
You will need to find the attachment with the given CID.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool


"Tomislav Petrovic" <t.pet...@inet.hr> wrote in message
news:eNw4NZIS...@TK2MSFTNGP12.phx.gbl...

Tomislav Petrovic

unread,
Jun 3, 2004, 2:51:53 AM6/3/04
to
I figured it would be something like that, but the question
for poor little newbie me is HOW???

I have a CID (I get it from the body) and have Attachments
array from the MailItem. How do I find attachement in the array
which has that CID?

Tomy.

Tomislav Petrovic

unread,
Jun 3, 2004, 4:02:26 AM6/3/04
to
Yet again I answer my own question :)

#ifndef PR_ATTACH_CONTENT_ID
#define PR_ATTACH_CONTENT_ID (PROP_TAG(PT_TSTRING,0x3712))
#endif

CComVariant varContentID(safeAttachment.GetFields(PR_ATTACH_CONTENT_ID));
if (varContentID.vt == VT_BSTR) {
strContentID = varContentID.bstrVal;
} else {
strContentID = _T("");
}

I suppose same goes here as for content type, has to be done using
Redemption, CDO or
Extended MAPI, no way to do it using ordinary Outlook API???

Tomy.

Dmitry Streblechenko (MVP)

unread,
Jun 3, 2004, 12:30:49 PM6/3/04
to
Yup, that's the way to do it - any API except Outlook Object Model can be
used.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool


"Tomislav Petrovic" <t.pet...@inet.hr> wrote in message

news:OJoZCCUS...@tk2msftngp13.phx.gbl...

0 new messages