Redemption Outlook Question2

  • Thread starter Thread starter Xcelsoft
  • Start date Start date
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
 
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
 
Back
Top