473,383 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

How to include a Microsoft Access report as the message body of an email?

MDestructive
First, let me say that VBA is not my strong point but I have been bestowed with creating a duplicate database of a former employee who sabotaged the original. And everyday this isn't working is creating a ton of manual work for other people. I have managed to get the entire database working with the exception of the final step.

Basically, you click three buttons, the first button imports many text files using the Open File Dialog window and shift key, sorts, manipulates and adds needed information to the line items. They are payments to customer accounts.

The final step used to be to click on a button and an Outlook New Mail Message window would pop up with a specific email distribution list in the To: Box, the email body was a nice looking summary (which I know originated from a report in Access and I have duplicated the report) and then automatically attached an excel document with all the data details (which I have also duplicated the excel doc). There was one week where I ran this database for him while he was out of the country and the document it attached would export to my desktop during the initial run of the data and I could delete it after the email was sent.

Long story short, my reports are called rpt_PaymentUploadData1 and rpt_PaymentUploadData2. There was one button for each email. They both go to different distribution lists but if I can figure out how to do one then the other will just be a copy with a few modifications.

I know this is asking a lot but does anyone have an example of something similar to what I speak of? I have searched many forums and do not know enough VBA to make this type of action work. I only understand about 20% of the VBA code the rest might as well be in another language. I have a course in February that should help me going forward but until then I am lost. Any ideas or pity out there on the Interweb?
Dec 15 '10 #1
5 4562
gershwyn
122 100+
Plenty of pity. Only one idea.

I have sent plenty of reports before as PDF attachments, but never included them in the body of the e-mail. You didn't say which version of Access you're using, but in 2007 at least you can export reports to HTML format.

Can your outgoing e-mails include HTML? If so, the first thing I would check is how your reports look when exported to HTML. I don't think they will include images, and the formatting may not be exactly as it appears on screen, but it may be workable for you.

I can't help with the code for putting the HTML into the body off the top of my head, but if this a route you may want to take, I'd be interested in knowing how to do it myself.
Dec 16 '10 #2
Thank you for the reply. I cant believe I forgot to mention I am using Microsoft Access 2003. Yes, I can export the report in a number of formats including html. It doesn't look spectacular but it would be acceptable. I basically just need the missing link to attaching the specific attachment and using the report as the email body. If I find a solution other than here then I will be glad to share it. I can usually figure VBA out but the codes I have found for this do not seem to work. I have to be missing something.
Dec 16 '10 #3
ADezii
8,834 Expert 8TB
Here is something that you can try in the meantime:
  1. Export the Report, say rpt_PaymentUploadData1, to *.rtf Format.
  2. Open the Outlook Window, and place the Cursor in the E-Mail Body.
  3. Insert ==> Object ==> Create from File
  4. Do NOT Link to File ==> Browse
  5. Select the newly created rpt_PaymentUploadData1.rtf File
  6. Insert
  7. The Report should now exist as an Embedded Object in the Body of the E-Mail.
  8. You can also experiment with other Output Formats to see which one produces the best results.
  9. I'm not exactly sure how to Code this sequence, but it should not be that difficult using Automation Code.
Dec 17 '10 #4
Thanks for your reply ADezii. I am doing something similiar to that in the test database as a tempory fix but I think I like your idea better because it will look just like the automated result (when and if I can get it to work). I never thought of embedding it as an object. Good idea. Thanks!
Dec 17 '10 #5
ADezii
8,834 Expert 8TB
You are quite welcome.
Dec 17 '10 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Nicola | last post by:
Hi Everyone, I am new to programming and would like to know how to open an access Report from within vb 6. I am trying to write a program to organise cross stitch threads. I have found out how...
1
by: Carol | last post by:
Hi, I am using VB.NET2003 on a Windows XP. I tried to write a simple program to send email with attachment (see below for the code). I add reference to "Microsoft CDO 1.21 library" and "Microsoft...
1
by: Jeffro | last post by:
Have two tables in a database. Addr: Name, Address, City, State Zip Class: Class Name, Start Date End Date What I would like to do is print one letter for each record in the Addr table...
9
by: Colin McGuire | last post by:
Hi, I have an report in Microsoft Access and it displays everything in the table. One column called "DECISION" in the table has either 1,2, or 3 in it. On my report it displays 1, 2, or 3. I want...
2
by: Aharon Koss | last post by:
I wrote a program in microsoft access to send a report via e-mail. The e-mail works great when I run the computer from a session on my server. However, when I auto schedule the job to run the...
0
by: George | last post by:
I have a Microsoft Access report and I have automated this report using C#. When the report opens (via DoCmd.OpenReport) I am confronted with several prompts for criteria (example: "Please enter...
0
by: George | last post by:
I have a Microsoft Access report and I have automated this report using C#. When the report opens (via DoCmd.OpenReport) I am confronted with several prompts for parameters (example: "Please enter...
0
by: George | last post by:
I have a Microsoft Access report and I have automated this report using C#. When the report opens (via DoCmd.OpenReport) I am confronted with several prompts for parameters (example: "Please enter...
1
by: Lost in Class | last post by:
I am relatively new to working with Access. I'm preparing a basic table and a form to enter data into. I'm having problems entering a validation rule and text. The field contains a currency figure....
0
by: flomaster | last post by:
Hi, I have created a c# application which uses Microsoft Access Reports. The application works ok on my laptop but when I installed it on other pcs ( more than 5 ) the following problem appears. ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.