Topics Search

Access 2010 PDF and Email a Report Using VBA Code

Access 2010 PDF and Email a Report Using VBA Code
Views: 282
I'm using Access 2010 and found the Send to Email as PDF command indispensible. However, I have a problem in that I've hidden the main ribbon from my users which means they can't actually click that button.

Can anyone tell me the VBA code that will let me PDF and email an indiviual report based on a given unique ID. I am happy for the user to add the email address, subject and message body and for them to click send
Sponsored Links:

More topics


email a pdf report

Is there a way to email a pdf report in an MS Access subroutine?

I know that I can use SendObject to send a Snapshot View of a report. But who is at the other end to read it? The CIA could use snapshot format to send secret documents and no one would be able to break the code.

I need to send things as pdf's.

Again, I need to send a pdf from a MS Access program directly to an email attachment.

Convert to PDF

A few quick questions in regards to converting a report to PDF.

At the moment the client uses the button on the Print Preview ribbon (Access 2010) to convert the report to a PDF file. Client is asking if it is possible to automatically select the "Standard Publishing" option as it seems to default to "Minimum Size" each time.

If I use VBA to open report as hidden, create email object and attach it as PDF does it automatically get converted to the highest quality

Send Report and Attachments in Email

User is looking at a job details. Job has pictures and PDF's as external files saved in the filesystem of the computer. User clicks Email Invoice. System attaches report as a PDFand opens Outlook Email message with email address, subject and body filled and the report PDF as an attachment

I can currently send a report as an attachment in an Outlook Email by using the "DoCmd.SendObject acSendReport" code.

That works nicely for me because it attaches the report I specify but has the limitation that I cannot attach any other objects.

I therefore came across the following code which allows me to add multiple attachments to an Outlook email message:


The problem with the above is that I cannot figure out how to attach a report of my choice. I don't know if there is a way to tell access to open a report and attach it as a PDF (in the above code).

Worst comes to worst, I'll try to figure out a way to save the report as a PDF (to the local filesystem) and then attach that as one of the attachments.

Email from

I have created a button that looks up a query then emails the from data as a pdf report to the person listed in the code below. to instead use the email address in one of the fields in the form itself.

I can do this via VBA in word but do not know the code well enough in Access to perform the same job.

emailing in access 2010

I'm currently using access 2010 to maintain a Model UN database, I need to send a mass confirmation email to head delegates of each team about their registration, and I need to attach a report in pdf, I have executed the macro action that converts the report in pdf and sends email to one head delegate but I want to automate the process, the email ID's of the heads are mentioned in the tblhead, and the report "paymentleaflet" has a query parameter of delegation ID(primary key of tblhead), how can I create a process that will, add the email address, from the query, select the report with the delegation id paramenter, attach it send it and move to the next record, and I dont have any expirence in visual basic

Displaying PDF files using VBA in access 2003

with code to open externally saved PDF files from a button on an access formn using VBA.

My pdfs are located in a folder on the c: drive

eg. c:/jobpacks/a/alfreton/yyy.pdf
/b/barnsley/xxx.pdf etc

All I want to do is open them and display them on the screen, I would then like to email them as an attachment

Report Caption

I am using Access 2010. I would like to know if there is a way, when a report is opened, that the name of the report can be based off of a field within the report as well as a standard name.

For example, when I open the service report for customer Johnson, I would like when I export the report (via email or save as pdf) that the report name be Johnson Service Report, rather than Service Report. This name would also change when I open the service report for cusotmer Wilcox, the report name would then be Wilcox Service Report. Is this possible?

This way when I save the pdf to the digital file I do not have to rename it, as well as if I am sending the report via email the specific customer will be noted in the report name without having to change it manually.

Export to PDF and Email Report

I have a report called [Banners Order Confirmation]. What I would like to do is with a click of a button, export the report as a pdf to a specified drive and folder and save it with a name by combining 2 fields from the report. Also, I would like to email this report to an email address which is also specified by a field on the report. I have tried different vb codes and have been very unsuccessful. Could you please help me or at least point me in some dirrection?

VBA code to send emails

I am running Access 2010 and I have created a IT helpdesk system. I want it to create an automatic email confirmation when we create helpdesk jobs.

I really need someone to help me with some code that will email the staff using Outlook 2010. I am not a expert on the code side of things.

I require the code assigned to the 'email button' and it will generate a email. Their email address will come from the Access database and in the body of the email there will job status, who it is assigned to etc. The email will then go to the persons email address.

I have attached a old copy of the database, I have saved it in 2000/03 incase people cant open it.

How to email several reports in pdf format to several recipients

I have several reports that I have made in access (2010) with it's reporting tool. What I would like to do is to send each of these reports off in an email to there corresponding departments. Sounds simple enough already huh?? Well I have the email function in place so that is finished but now what is happening is when I try to save the reports off in pdf format so they can be attached to the emails. I get a run time error, a "2046 The command or action 'Output To' isn't available now. I attempted to solve this by putting a "DoEvents" after the OutputTo and it continued to throw the same error. I then proceeded to make a timer function to cause the subroutine to "pause" for a few seconds and it worked for the first report but when the second report tried to produce BANG the same error.

For some background on what I am trying to accomplish here. I have a table that contains the PersonnelName, email, cc, subject respectively and are all text fields. The code calls a recordset to "lookup" the respective fields and produce an email with the report attached. I am not so worried about saving the report as attaching it to the email to be sent out as this is done daily. Oh I should probably mention this is all done by clicking a command button. So how would I go about producing the pdf for attachment?