Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

MS Acces Save Report to PDF with Code

Posted on 2010-09-13
6
Medium Priority
?
1,159 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 500 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 500 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
 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

 
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 500 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 500 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
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…
We often encounter PDF files that are pure images, that is, they do not have text characters, but instead contain only raster graphics. The most common causes of this are document scanning software and faxing software/services that create image-only…

670 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