Redemption Outlook Question2

X

Xcelsoft

Many thanks Dmitry for your response to my earlier
question regarding inserting a jpeg file into the body of
an email message.

Your references were exactly what I was looking for. I
just have one question. I am using the code below which
works fine but that are some parts that I am trying to
understand. I can understand the reason for hidding the
paper clip, defining the attachment, and content type.
What I don't understand is the Attachment CID. What is
the purpose, can you shed some light???

Thanks

'tell Outlook to hide the paperclip icon

Dim PT_BOOLEAN
PT_BOOLEAN = 11
Dim PR_HIDE_ATTACH
PR_HIDE_ATTACH = objSafeMail.GetIDsFromNames("{00062008-
0000-0000-C000-000000000046}", &H8514) Or PT_BOOLEAN
objSafeMail.Fields(PR_HIDE_ATTACH) = True


'add attachment

Set objOutlookAttach = objSafeMail.Attachments.Add
("c:\temp\MyFile.jpg")


'content type

objOutlookAttach.Fields(&H370E001E) = "image/jpeg"


'Attachment cid

objOutlookAttach.Fields(&H3712001E) = "myident"

objSafeMail.HTMLBody = "<IMG align=baseline border=0
hspace=0 src=cid:myident>"

objSafeMail.Save


'Send

objSafeMail.Send
 
D

Dmitry Streblechenko \(MVP\)

It is the content-id. When HTML is rendered, IE asks Outlook to provide the
file given the content id specified in the img src tag. Outlook finds the
attachment with the given value of CID and returns it to IE.

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

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