Solved

MS Acces Save Report to PDF with Code

Posted on 2010-09-13
6
1,151 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 - Microsoft MVP, Access and Data Platform) 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

734 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