Solved

MS Acces Save Report to PDF with Code

Posted on 2010-09-13
6
1,147 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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

PDF files have been in the limelight due to its unmatched features.  Personal documents, emails, business reports and eBooks are all converted into PDF files owing to peerless features provided by it. Adding watermark to a PDF file is a method to se…
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
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…

756 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