[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

How To Embed Image in HTML MSAccess Report Output

Posted on 2014-11-24
4
Medium Priority
?
621 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 25

Expert Comment

by:chaau
ID: 40463426
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 2000 total points
ID: 40464343
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
ID: 40464976
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
ID: 40465196
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
Audit trails are very important in any system to hold people responsible for certain transactions and hold them to take ownership of their actions. This article is dedicated to all novice "Microsoft Access" developers.
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

607 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