Ouput a report as .pdf

W

wendywi

Is there a way to print a report to a .pdf file without using the print
function on the menu?
 
S

SirPoonga

Are you talking about an Access Report?
If so, you have Adobe Acrobat installed then, obviously otherwise I
don't think the option would be there.

Are you trying to convert using code? What other way would you like to
do?
 
W

wendywi

I have a database that generates goverment forms and we need to send the
access reports via a .pdf file. We have adobe acrobat but I was wondering if
there was a way to build a macro or code that a print function would send the
file to a a .pdf format. I have worked with macros to output to text and
excel, but there is no option for .pdf. It just seemed to make sense that
somehow there is a way to automate this for the user.

Thanks for taking the time to try to help - I appreciate it!
Wendy
 
I

Immanuel Sibero

Hi,

Good information here,

http://www.granite.ab.ca/access/pdffiles.htm

access reports via a .pdf file. We have adobe acrobat but I was wondering if
there was a way to build a macro or code that a print function would send the
file to a a .pdf format. I have worked with macros to output to text and
excel, but there is no option for .pdf. It just seemed to make sense that
somehow there is a way to automate this for the user.

When you say you have Adobe Acrobat, do you have the free "Acrobat Reader"
or the full version product?
If you only have Acrobat Reader installed, you wont be able to create pdf
files from Access. You would need the full version of Acrobat before you can
create pdf files from Access.

The full version of Acrobat will install a printer on your computer. You
would then print to that printer from Access. You can do this
programmatically in VBA.

However, please go through the information on Tony Toew's site first and
look at all available alternatives. You may find that other alternatives are
easier to implement. If you decide to use Acrobat, then post back on this
newsgroup for more information Actually you can also visit:

http://www.mvps.org/access/reports/rpt0011.htm

for more information on how to use Acrobat to create pdf files from Access.

HTH,
Immanuel Sibero
 
S

SirPoonga

<<The full version of Acrobat will install a printer on your computer.
You
would then print to that printer from Access. You can do this
programmatically in VBA.>>

I figured you could do that too. I remember finding a free print
driver out there that prints to PDF. I haven't used a PDF writer in
sometime though.

How would you do that programmatically?
 
W

wendywi

Thanks to all for the help! I have a starting point now. I know there are
some free pdf converters out there, but I work for a large corp and they
frown:( on shareware. But I will check out the options!

Have a good one! Wendy
 
I

Immanuel Sibero

SirPoonga,

Yep.

In VBA:
- With windows API call, change your default printer to the PDF Writer.
- Specify a file name
- Do an Docmd.Openreport
- With windows API call, change your default printer back to whatever it was
before.

Immanuel Sibero
 
I

Immanuel Sibero

some free pdf converters out there, but I work for a large corp and they
frown:( on shareware. But I will check out the options!

Frowning on shareware is not a bad thing. There are perfectly good reasons
for it. Just so long as our eyes are open to the fact that there are very
very good shareware out there.

Immanuel Sibero
 
J

J. Clay

Actually, you don't need the Windows API in Acces 2k and up. You can set
the printer from within VBA by using:

Set Application.Printer = Application.Printers("Printer Name")

To restore to your default printer use:

Set Application.Printer = Nothing

The trick is to have a standard printer name that you will be switching to
if there are multiple users. In our case we use PDF995 to print to pdf
(www.pdf995.com) and use the default printer name on all workstations.

Jim
 
J

J. Clay

I understand!

I actually have expanded the use of the PDF995 solution to create an e-mail
and link the pdf file. PDF995 also has a security option that we have
purchased to allow automatically securing the PDF for viewing and printing
only. This is how we send our Purchase Orders, as well as a couple of other
reports. The key is you have to set up a delay in your VBA to allow enough
time for the security to get applied, but all in all, it has been a great
solution for us.

Regards,
Jim
 
I

Immanuel Sibero

J. Clay,

Noted! The routine I mentioned was actually from memory of using A97 about 4
or 5 yrs ago (40+ years in human years <g>).

Immanuel Sibero
 
S

SirPoonga

Actually, it's freeware, same difference though.

I have several links bookmarked on my home computer I could share if
you want.
 
Top