Solved

MS Acces Save Report to PDF with Code

Posted on 2010-09-13
6
1,143 Views
Last Modified: 2013-11-28
Need to Send an Access 2003 Report to a PDF without being prompted for anything using VBA. I have Full Adobe and Distiller but can not find any examples of using them to send a report to PDF. I would actually like to go a step further if possible and edit that PDF to apply bookmarks programatically as well if that is possible. I have Adobe Acrobat which installed Access object but I can not find help on using them.

Thanks
0
Comment
Question by:mjmill
6 Comments
 
LVL 16

Expert Comment

by:Sheils
ID: 33666856
Simplest way is to just right click on the report then click print. Select Adobe as your print and away you go.

0
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Access MVP) earned 125 total points
ID: 33666861
Attached is Steve Leban's (http://www.lebans.com)  SnapShot To PDF ... generates a PDF independent of Adobe.  For some reason, I cannot find it on his site anymore ...

I've used this a couple of times.

You *may* be able to tweak the code for your need; however I won't be able to help with that or answer questions on how to use it ....

Good luck ...

mx
A2000SnapshotToPDFver751.zip
0
 
LVL 34

Assisted Solution

by:jefftwilley
jefftwilley earned 125 total points
ID: 33667310
I worked through this way back when.

http://www.experts-exchange.com/Microsoft/Development/MS_Access/Q_21944675.html

That's the full adventure if you care to read through it.

J
0
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
LVL 75
ID: 33667339
jt ... I still haven't forgot the Round form, lol.

mx
0
 
LVL 19

Assisted Solution

by:Eric Sherman
Eric Sherman earned 125 total points
ID: 33667653
This is how I do it using Access 2003 and above ....  My PDF Driver is set to output all reports to C:\PDFOut\Report1.pdf.

Use the Printer Object to select the PDF Printer

Dim prt As Printer
prt = Application.Printer
Application.Printer = Application.Printers("YourPDF PrinterName")

'Print your report
DoCmd.OpenReport strYourReportName

'Rename and copy the report to your desired location
 FileCopy "C:\PDFOut\Report1.PDF", "T:\MyFolder\MyFile.PDF"
 Kill ("C:\PDFOut\Report1.pdf")

'Reset your default printer
Application.Printer = prt


ET
0
 

Assisted Solution

by:dp2010
dp2010 earned 125 total points
ID: 33677850
Most of the proposed solutions focus on the idea of printing to the Adobe PDF printer.  Automating this is possible, but by the time you have a PDF it's too late to programmatically add bookmarks.  Instead, automate printing valid postscript to file (i.e. from a valid PS printer driver) and then after that file has been generated (it can take a while) move it to the Distiller "Watched Folder".

To add bookmarks, insert valid PDFMark code (an extention to PS) into the valid PS file before it gets moved into the watched folder and processed by Distiller.  The authority on how to make PDFMark is or was called the "red book", but there is a smaller reference out there too.  You may need to understand and handle reserved PDFMark characters.

This is how I have done this in the past (see http://www.davepepper.com/screenshots/PDFConcatenator.gif).  My understanding is that ActivePDF is now the best way to do this, and I swore that the next time I had a need I would not roll my own again.  Take a deep breath and read their licensing and pricing.

Also take a look at the distiller code samples on the Acrobat Pro disc, especially for concatenating and PDFMark.
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ms access 2010 vba, copy table from db1 to db2 from db3 27 39
Pagination in Adobe Acrobat 13 46
Access report groups with sums 5 24
Delete QueryDef IF it Exists: Access VBA 5 28
PaperPort is a popular document imaging/management product from Nuance Communications (http://www.nuance.com/). It is in widespread use by both individuals (http://www.nuance.com/for-individuals/by-product/paperport/index.htm) and businesses (http:/…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Sometimes we receive PDF files that are in the wrong orientation. They may be sideways or even upside down. This most commonly happens with scanned or faxed documents. It is possible to rotate the view of these PDFs with the free Adobe Reader produc…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

813 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