embedded graphics in HTML

G

GeorgeMar

I am trying to send an email created in outlook and saved as a HTML, using
VBA. The email has a gif file embedded. Using .HTMLBody I can send the
email if I write the pathname of the gif file but if I accept the default
name given by Outlook it doesn't work.

For example here is the HTML output from Outlook of a test email:

<META HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=iso-8859-1">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1106" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>dear zzz</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2><IMG alt="" hspace=0
src="cid:[email protected]" align=baseline
border=0></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>thanks</FONT></DIV></BODY></HTML>

I Import these lines into my application's HTMLBody. The gif file is shown
as

src="cid:[email protected]"

If I send this, I get the icon for an unreconised graphics.

If I replace the above line with: src="c:\filename.gif" it works.

Is there a way that I can get the HTML output, listed above, to work without
having to change the src to hardcoded filename?
 
G

GeorgeMar

Thank you Sue

I have read your codes. That implies that the user would have to compose
the email in outlook with the embedded images, save to HTML and then, when
they send using my application, they would have to enter the file names again.

Is there a way to force Outlook to save the HTML with the file pathname
rather than the reference that it shows now?

regards
george
 
S

Sue Mosher [MVP-Outlook]

Outlook does have a setting in Tools | Options that controls whether images in HTML messages will be embedded or use external links, but most users are going to have it set to send with embedded images, and you can't change it on the fly while Outlook is running.

I'm still a little vague on what your application is trying to do.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
G

GeorgeMar

Hello Sue

Thank you again

I'll try to explain. I have an Access application that sends email to a lsit
of recipients from the database. The user picks the recipients, types the
message, then the subject and click the send button, and it goes.

What I am trying to do is to give the users two options to create the body
of the message. They can either create the body by typing the text into a
Text Control on the screen (which, of course, is not formatted) or build the
body in Outlook or Outlook Express and save the text as HTML. Then, when
they hit send it prompts them for the file name of the saved HTML and my
application Opens the file and read in the HTML text into the body and send
it.

I have been able to get the text part of the HTML to work but not the
graphics component.

On a separate matter, lately Outlook has been locking up when I have been
sending these messages.

I hope that that clarifies it, and that you may perhaps have a more refined
solution.

regards
george
 
S

Sue Mosher [MVP-Outlook]

The problem is that, as I understand your description, you're only using the HTML that the user saves, not the whole message with its attachments (including embedded graphics). So, if you want to transfer that HTML to a *new* message, you will need some way of also saving the image attachments or at least their locations when the user saves the HTML.

Why can't you let the user create the whole message, instead of just saving the HTML? If you used the whole message and just added recipients, it would be a lot simpler.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 

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