Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 30th, 2003, 12:25 AM
Registered User
 
Join Date: Jun 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Printing reports in pdf format

Hi there

Has anyone out there figured out how to automate the process of printing Access reports to pdf (Acrobat Reader) format?

Cheers
Anish
 
Old June 30th, 2003, 06:03 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 839
Thanks: 0
Thanked 1 Time in 1 Post
Default

If you install Adobe Acrobat, it will install "virtual" printers named Acrobat Distiller and PDFWriter. Sending report output to either of these "printers" will create a PDF file. Note that PDFWriter is for use with reports that contain only text, while distiller will handle images as well.

Jeff Mason
Custom Apps, Inc.
www.custom-apps.com
 
Old June 30th, 2003, 05:40 PM
Registered User
 
Join Date: Jun 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for that Jeff. I've got the virtual drivers setup. I somehow need to automate the report printing to pdf in VBA.

I've got a report setup up where I pass a ClientID as a parameter to generate a report. I've got about 50 clients and was thinking of writing code that could save the pdf file under each client name, and loop through all 50 clients.
 
Old October 5th, 2004, 02:09 PM
Registered User
 
Join Date: Oct 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

keshavan01,
I'm just wonder if you have the solution of how to do this. I am having the same problem. I couldn't automatically sending the Access report to the PDF virtual printer. It asked me to enter the file nam every time. if you could send me the solution I would very appreciated
thanks


 
Old January 27th, 2005, 06:38 AM
Registered User
 
Join Date: Jan 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have exactly the same problem - if anyone comes up with the solution - I will be thrilled !. At present I generate them as .snp reports and then when you one those and print to a Virtual printer it has the name there with the directory which you have to change - not ideal but a stop gap measure.

 
Old January 27th, 2005, 12:21 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Well, I know that these registry settings can be used with some versions, but I don't think all. You can change them each time you print based on your reports:

Names the file:
HKCU\Software\Adobe\Acrobat\PDFWriter, PDFileName, C:\YourReport.pdf

Prevents file naming dialog from appearing:
HKCU\Software\Adobe\Acrobat\PDFWriter, bExecViewer, 0

Also, this will prevent the dialog in V6:
HKCU\Software\Adobe\Acrobat\PDFMaker\6.0\Global\Se ttings\PromptForPDFFilename, 0

You can make registry settings from within Access. Don't forget to set them back when you are done printing.

Then if you want to name your files, you could capture all your client IDs, then use the UBound for a loop counter, and then loop through all their names, use their names to name the files, and then maybe append a date as part of the filename, etc.

I hope this will get you started. In can be done.


mmcdonal





Similar Threads
Thread Thread Starter Forum Replies Last Post
printing a php file in .pdf format farukcse Pro PHP 0 November 18th, 2007 03:13 PM
Printing to a PDF hathcock Access VBA 3 September 29th, 2006 10:46 PM
capturing printing settings when printing reports nikolaosk Access VBA 0 February 8th, 2005 04:14 AM
Sending Access Reports to PDF Format jhartwick Access VBA 1 May 2nd, 2004 08:00 PM
PDF Printing matt.fields Crystal Reports 0 April 30th, 2004 10:33 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.