Access 2010 PDF and Email a Report Using VBA Code

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:

Related 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:

[CODE]

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?


Printing report as PDF file in Access 2000
I would like to know if there is any why to print an access 2000 report as a PDF file so I can email it. I know I will need to loop through a list of contacts, read in their email address and then send the pdf file as an attachment and think I can do this. The problem I am having is getting access to create the PDF file.


Email PDF from Access 2007 using VBA
As it stands my users fill in a form, click print and a report is popped in an envelope and sent to our customer.

BUT, We're using Access 2007 and what I want to happen is.

My users fill in a form, click attach and an Outlook email message is opened, the report is turned into a pdf and attached.


Filter a Report Based on an Attribute a to be Emailed VBA
I'm using Windows 7, Access 2007, Outlook 2010

Background:
I've written the script to generate the email, attach the report (actually in the body of theemail) and send it to the correct people.

Issue:
My issue is that I want to send only the relevant records from the report to each person. I've put the relevant person's email into the report (of a query) to make it easier. I want to email all the records with one email address to that email address and so on.

Example:
This would mean, for example, there are 6 records with [@email] in the email field of the report and 3 records with [@email]. I want the 6 records with [@email] to be emailed to [@email]and the 3 records with [@email] to be emailed to [@email].


Email report as body of email
I want the user to click a button (on the form) that generates an html report and sends an email, through Outlook 2010, with that report being the body of the email not as an attachment.

I'm looking to accomplish this through VBA and I have tried everything that I can think of and still am unable to get it to work.


Office Version
I've been very successfully using the code to create a snapshot of a report and then converting it to pdf to send as an email attachment.

I've just upgraded to Office 2010 and realised that this didn't work any more and have re-written the code to use the facility to send the report as a pdf.

However, the rest of the users are still using 2003, and refusing to upgrade, so is there some way I can check to see which version of software the user is using and if it's Office 2003 do one thing and if it's Office 2010 do something else?

How would I find that out


How to save a report as a pdf file - 2010
Just updating our database following conversion from 2000 to 2010.

Used Stephen Lebans code to save reports as .pdf in 2000 but doesn't work well with 2010.

I know 2010 allows reports to be saved as .pdf files but just having a mental blank on how this is done


MS Access 2003 Mail Merge and Mailing from Outlook
I have a process of mass mailing to customers.I have a fixed body of letter which goes in my email (outlook 2003) along with a pdf attachment personalized to each customer.

Is there a way to email from access(2003) through Outlook(2003) with the pdf attachment. Please note the pdf attachment is personalized so when I email X customer the pdf address to X should come . I name the pdf with the customer code and the same code and email is available in access table also.

I am exploring an option for this mass mailing and also want to know how I can do mailmerge using Access presently my excel holds data and I merge it in word


Access 2010 crashes attempting to email a report
What email client is required to use the "Send Object As" dialog in Access 2010?

I have two systems both running Outlook 2002 that will consistently crash Access 2010 if I attempt to email a previewed report. On a Windows 7 system with a full copy of Access 2010 if I preview a report click the Email button on the External Data ribbon then select any file type (txt, rtf, pdf) in the "Send Object As" dialog, "Outputting page 1 of MyReport to a mailmessage" appears followed by the "Microsoft Access has stopped working" popup.

The same scenario occurs on a Windows XP system using the Access 2010 runtime and a custom toolbar button that opens the "Send Object As" dialog from the print preview window. It works correctly on either system using Access 2002.
I don't have a test system readily available with a newer Outlook version.


Converting report to PDF and attach it to email
I've been trying to find solutions how I am able to convert currently opened report to PDF and attach it to outlook e-mail. I am using Access2k10 and I tried EmailDatabaseObject macro function and SendObject through VBA but these have some flaws that I can't have. I need message body to be either from template file (message text is different which depends on area to where email will be sent). Both that I mentioned don't let me format body text in html which I need as I must get logo to email together with long text.

Any suggestions how it's the easiest way to do these two (convert to pdf and attach to outlook) operations with one button click?


Converting report to PDF and attach it to email
I've been trying to find solutions how I am able to convert currently opened report to PDF and attach it to outlook e-mail. I am using Access2k10 and I tried EmailDatabaseObject macro function and SendObject through VBA but these have some flaws that I can't have. I need message body to be either from template file (message text is different which depends on area to where email will be sent). Both that I mentioned don't let me format body text in html which I need as I must get logo to email together with long text.

Any suggestions how it's the easiest way to do these two (convert to pdf and attach to outlook) operations with one button click?