Solved

How To Embed Image in HTML MSAccess Report Output

Posted on 2014-11-24
4
477 Views
Last Modified: 2014-11-25
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?
0
Comment
Question by:JJENSEN3
  • 2
4 Comments
 
LVL 24

Expert Comment

by:chaau
Comment Utility
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
 
LVL 18

Accepted Solution

by:
bonjour-aut earned 500 total points
Comment Utility
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
 

Author Comment

by:JJENSEN3
Comment Utility
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
 
LVL 18

Expert Comment

by:bonjour-aut
Comment Utility
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

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This article discusses how to create an extensible mechanism for linked drop downs.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now