Print Report to PDF with .pdf Name and Print Driver coded

  • Thread starter rwboyden via AccessMonster.com
  • Start date
R

rwboyden via AccessMonster.com

I am assembling a number of smaller pdf files into a single file. In the
process I need to create some cover and separator sheets as reports and save
them as pdf's via the pdf995 utility. How can I, in code (or with a macro
accessed in code), specifiy the pdf995 driver, a specific filename and a
destination folder when saving these files. I know how to do it manually
using Docmd.Openreport "rptXXX", acViewPreview, and using File - Print but
the VBA approach eludes me.

Thanks for any help.
 
A

Albert D. Kallal

I don't belive that pdf99 supprots what we call object automaton, and
therefore sepcifying the output file name is a real pain prociess.

You BEST soltion is to use Stehapns soltion:

The advangaes are:

no nag or adversting
no need to install a pdf printer driver (and code to "change" the
printer driver is needed)
no need to write code to "swtich" to a printer driver
no need to "install" a software package on the target mahcine (this
makes deployment of your software VERY easy)

thus, with Stephans sotion, you can specify the pdf output file name with
ease.

You find his soltion here:

http://www.lebans.com/ReportUtilities.htm

To specify the output name for a report, you go:
strdocName = "c:\mypdfotuput\test.pdf"
Call ConvertReportToPDF(strReportName, , strDocName, False, False)

Your next problem is how to combine these several pdf's documents into ONE
document. That is a bit more tricky of a problem, but the best free solution
for that is to use pdfcrator (and again free).

You can find it here:

http://sourceforge.net/projects/pdfcreator/

After you install the above, take a look in the program files
directory...there is some sample vbs scripts that show how to combine
several pdf's into one pdf....
 
R

rwboyden via AccessMonster.com

Thanks ...this works beautifully. I'm using a report to create a separator
page, opening it to load it with data, then moving it to a folder as a .pdf
with a new name using the utility you suggested. The only problem is that
the report never gets closed and, thus, retains the data from the initial
opening rather than being repopulated for each new case. I can't seem to find
any code to close an open report. Since the reports run asynchronously,
manual closing won't work. Is there code to handle this?

Again, Albert, many thanks ... and Stephan Lebans is a jewel!

Bob Boyden
 
R

rwboyden via AccessMonster.com

rwboyden said:
I am assembling a number of smaller pdf files into a single file. In the
process I need to create some cover and separator sheets as reports and save
them as pdf's via the pdf995 utility. How can I, in code (or with a macro
accessed in code), specifiy the pdf995 driver, a specific filename and a
destination folder when saving these files. I know how to do it manually
using Docmd.Openreport "rptXXX", acViewPreview, and using File - Print but
the VBA approach eludes me.

Thanks for any help.

I found the answer lookinig through Close Reports. DoCmd.Close acReport,
"rptName", acSaveNo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top