How To Embed Image in HTML MSAccess Report Output

I have written code in Access 2007 that outputs a report that contains our company logo at the top of the report. When I programatically export the report to a file in HTML format using VBA, the image is not being saved to the file.

How can I ensure that this image is embedded in the file when it is exported?
JJENSEN3Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

chaauCommented:
You cannot embed image to HTML. Its the standard. The HTML page has just an <img> element with the image stored as a separate file. You will have to keep the images separately.
I recommend you use a different export format, such as PDF, or RTF
0
bonjour-autCommented:
Hi ,

chaau is correct, that you cannot export an image from the report to the HTML file.
But if it is just to have fixed formating on the HTML, you can use an HTML template for the Export.
In the simplest case it would look like below example: Access will put the report output exactly at the position of '<!--AccessTemplate_Body-->'
Thee are more things, which you can do with the template like adding navigation for multipage report etc.

<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=windows-1252">
<TITLE>Reporttemplate</TITLE>
</HEAD>
<BODY>
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 >
<TR HEIGHT=24 >
<TD WIDTH=103  ALIGN=LEFT ><img src="EE_test.jpg"></TD><TD WIDTH=590  ALIGN=LEFT  BGCOLOR=#FFFFFF ><FONT style=FONT-SIZE:16pt FACE="Calibri" COLOR=#7f7f7f>Company Name</FONT></TD>
</TR>
</TABLE>
<!--AccessTemplate_Body-->

</BODY>
</HTML>

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
JJENSEN3Author Commented:
I think bonjour-aut is getting me closer to what I want. I am just not sure I am taking the right steps to get there.
What I am actually trying to do is send order acknowledgement emails from a report that is generated in Access 2007. I would like that email to show up with our logo and a link to our website in the body of the email. Similar to what you get when you buy something from Amazon, for example - Their logo appears and they allow you to click in the body of the email to view order status.

Can this actually be done with the method I am utilizing?
0
bonjour-autCommented:
If we are talking about sending a singular HTML-body per mail, the method to use a report seems rather a detour.  Usually you would generate a mail directly by using one of the following 3 methods:
1. use the locally installed outlook client
2. Use the MS-CDO-component, which works directly to a SMTP server
3. Send data to a web script, which does the job, e.g. a PHP script.
Please ba aware, that many mail clients at the customer side block embeded components like images for security reasons.
To my juddgement, you should plan a mail order confirmation as text or PDF attachmnet.
Nevertheless it is technically possible to use a report as intermediate tool to genereate a static HTML page with logo-image.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.