Solved

MS Acces Save Report to PDF with Code

Posted on 2010-09-13
6
1,140 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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

One of the questions I get asked again and again is how to validate a field value in an AcroForm with a custom validation script. Adobe provided a lot of infrastructure to do that with just a simple script. Let’s take a look at how to do that wit…
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:/…
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

707 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

13 Experts available now in Live!

Get 1:1 Help Now