By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,398 Members | 947 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,398 IT Pros & Developers. It's quick & easy.

Outlook Automation and graphics

P: n/a
Using Outlook Automation, is there a way to insert a graphic in the
body of an e-mail so that it appears at the top of an email?
lq
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
I have a way, but it is a workaround. The message must be sent as HTML
Format and you format the entire body of the message as string that you pass
to the HTMLBody property of the MailItem class. Just include an image tag
(for example, <img src='http://www.someserver.com/mylogo.gif' align='right'
width=450 height=192 border=0 alt="My Company Name">) that refers to an
image you have stored on a web server somewhere. This has some obvious
limits, but the company I work for uses this method to send quotes every day
without bumping into them yet. Good enough, but not perfect.

This is some background about what you are trying to do. If you open a
message that was created in outlook and contains an image, right click it
and view the source, you will see a tag with something like <img
src="cid:im**********@01C40CE2.BC9414E0">. The URL refers to the image that
is included elsewhere in the message. That elsewhere would be delineated as:

Content-ID: im**********@01C40CE2.BC9414E0
Content-Type: IMAGE/GIF
Content-Transfer-Encoding: BASE64

R0lGODlhGAGgAPEAAP/////ZRaCgoAAAACH+PUNvcHlyaWdodCAoQykgMTk5
NSBJRVRGLiBVbmF1dGhvcml6ZWQgZHVwbGljYXRpb24gcHJvaG liaXRlZC4A
etc...

But, you can't see this part, Outlook doesn't expose it to us. I know this
is what is happening by it is described in RFC 2111 at
http://www.faqs.org/rfcs/. I haven't found an exposed or hidden method that
allows you to include content in the message by automation. I would like to
be able to do it the same way Outlook and other email tools do. But I don't
want create the entire message from scratch and send it by SMTP, in effect
creating my own email system.

There are some tantalizing messages in other news groups, for instance I
have seen one that indicates it might be possible to do this from MS Word,
but I haven't tried or tested it. Another refers to including the image as
an attachment and referring to it with a relative reference. Google "image
in email"

I didn't answer immediately because I hoped someone else had a different
answer. The workaround works.

HTH
--
Jeffrey R. Bailey
"Lauren Quantrell" <la*************@hotmail.com> wrote in message
news:47**************************@posting.google.c om...
Using Outlook Automation, is there a way to insert a graphic in the
body of an e-mail so that it appears at the top of an email?
lq

Nov 12 '05 #2

P: n/a
Jeffrey,
Thanks for this. I figured out that HTML works and I apply a template
to locate the image. That works fine, except, if the data being
exported to Outlook is more than one page, it wants to make multiple
e-mails out of it.
Sort of a drag. So what I have done instead is to export as RTF and
use an Outlook template file that has the logo already.
lq

"Jeffrey R. Bailey" <Mr******************@yahoo.com> wrote in message news:<hV******************@twister.tampabay.rr.com >...
I have a way, but it is a workaround. The message must be sent as HTML
Format and you format the entire body of the message as string that you pass
to the HTMLBody property of the MailItem class. Just include an image tag
(for example, <img src='http://www.someserver.com/mylogo.gif' align='right'
width=450 height=192 border=0 alt="My Company Name">) that refers to an
image you have stored on a web server somewhere. This has some obvious
limits, but the company I work for uses this method to send quotes every day
without bumping into them yet. Good enough, but not perfect.

This is some background about what you are trying to do. If you open a
message that was created in outlook and contains an image, right click it
and view the source, you will see a tag with something like <img
src="cid:im**********@01C40CE2.BC9414E0">. The URL refers to the image that
is included elsewhere in the message. That elsewhere would be delineated as:

Content-ID: im**********@01C40CE2.BC9414E0
Content-Type: IMAGE/GIF
Content-Transfer-Encoding: BASE64

R0lGODlhGAGgAPEAAP/////ZRaCgoAAAACH+PUNvcHlyaWdodCAoQykgMTk5
NSBJRVRGLiBVbmF1dGhvcml6ZWQgZHVwbGljYXRpb24gcHJvaG liaXRlZC4A
etc...

But, you can't see this part, Outlook doesn't expose it to us. I know this
is what is happening by it is described in RFC 2111 at
http://www.faqs.org/rfcs/. I haven't found an exposed or hidden method that
allows you to include content in the message by automation. I would like to
be able to do it the same way Outlook and other email tools do. But I don't
want create the entire message from scratch and send it by SMTP, in effect
creating my own email system.

There are some tantalizing messages in other news groups, for instance I
have seen one that indicates it might be possible to do this from MS Word,
but I haven't tried or tested it. Another refers to including the image as
an attachment and referring to it with a relative reference. Google "image
in email"

I didn't answer immediately because I hoped someone else had a different
answer. The workaround works.

HTH

Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.