Re: Create macro which automaticallly creates PDF of a report
- From: ChuckW <haji@xxxxxxxxxxx>
- Date: Tue, 25 Jul 2006 14:23:03 -0700
Ken,
Thanks for your help. I actually downloaded and install the lebans
application. It will automatically convert a report into a pdf file. It has
a form in it that lists all of the reports available. There is a button at
the bottom that says "Click here to save this report as a pdf file". When I
click this button it opens the report in pdf format. What I really want to
do is the run this entirely in batch mode. I want to set up a scheduled task
so that at 6:00 am, the pdf file will be created and then saved to a certain
file. Any idea how I go from have to manully click on a report listed on a
form and manually saving the file to a certain folder to actually doing this
as a scheduled task? The report would be done once a week and would have the
same name and location every week.
Thanks,
Chuck W
"Ken Snell (MVP)" wrote:
If the PC on which your database runs has the CutePDF printer set as the.
default printer, then all you need do is print the reports (macro action
OpenReport); they'll be printed to PDF format. I haven't used CutePDF in a
while, so I don't recall if it requires user intervention for naming the
file that is to be created -- if it does, a user would need to be involved
when the macro is executing.
Otherwise, Stephen Lebans has a neat PDF utility for creating PDF files --
haven't used it, but other MVPs have raved about its usefulness and
versatility. See http://www.lebans.com/reporttopdf.htm for the info and
code. This will require use of VBA programming, not macro, although you can
run VBA code from a macro using the RunCode action that calls a public
function that then runs the desired VBA code.
Let us know what you decide you want to try to do.
--
Ken Snell
<MS ACCESS MVP>
"ChuckW" <haji@xxxxxxxxxxx> wrote in message
news:11EA5223-91BD-4950-AFE9-8604AD556371@xxxxxxxxxxxxxxxx
Ken,
Thanks for your help. I have a main database that many people use and I
am
attempting to create a separate database whose sole purpose is to create
files based on reports. I have an autoexec macro that imports tables in
from the main database and I have scheduled it to run every day. I have
imported various queries and reports from the main database as well. I
want
to schedule this to run in the morning on our fileserv. We do have a pdf
write called Cute PDF which is a free writer I downloaded and installed
on
our server. So I won't need to applicatioin to switch the printer back
and
forth. I only need it to print a report. I want to include this is part
of
my autoexec macro. How would I imbed code into this macro and should I
still
use the code you were suggesting?
Thanks,
Chuck
--
Chuck W
"Ken Snell (MVP)" wrote:
You'll need a PDF printer driver to be installed on your machine. Then
you'll need to use VBA code (not a macro) to change the printer
assignment
to the PDF driver, print the report, and then change the printer back to
the
default printer. Note that this will work using Application.Printers
object
in ACCESS 2002 and 2003.
--
Ken Snell
<MS ACCESS MVP>
"ChuckW" <haji@xxxxxxxxxxx> wrote in message
news:27A2E8D0-4711-4469-9F53-74BBE95BEA66@xxxxxxxxxxxxxxxx
Hi,
I want to create a macro that when run will automatically create a PDF
of
an
access report and save it to a certain folder. Can someone help?
Thanks,
--
Chuck W
- Follow-Ups:
- Re: Create macro which automaticallly creates PDF of a report
- From: Ken Snell \(MVP\)
- Re: Create macro which automaticallly creates PDF of a report
- References:
- Re: Create macro which automaticallly creates PDF of a report
- From: Ken Snell \(MVP\)
- Re: Create macro which automaticallly creates PDF of a report
- From: Ken Snell \(MVP\)
- Re: Create macro which automaticallly creates PDF of a report
- Prev by Date: Re: Report footer summing
- Next by Date: Re: Print Title on Report from form filter
- Previous by thread: Re: Create macro which automaticallly creates PDF of a report
- Next by thread: Re: Create macro which automaticallly creates PDF of a report
- Index(es):