Group:  Microsoft Access ยป microsoft.public.access.macros
Thread: print multiple reports

Geek News

print multiple reports
"shank" <shank[ at ]tampabay.rr.com> 12/27/2008 2:54:19 AM
What's the easiest way to print 30 reports? Even more as time passes. I'm
assuming a macro.

First issue: I need to open the report in print preview so the caption can
build itself. Then I need to issue a print command to go to my PDF printer,
which I have set as default. The caption becomes the PDF filename. That's
why I need the report to open fully.

OK, moving on, once the print command is issued, I see no way to
automatically hit the OK button on the print dialog box. Then, if there
happens to be a previous file by that name, I need another command to hit OK
to overwrite again.

How do I get the last 2 commands to hit the OK buttons on the dialog boxes?

thanks


Re: print multiple reports
"Steve Schapel" <schapel[ at ]mvps.org.ns> 12/27/2008 3:12:39 AM
Shank,

You would use an OpenReport action in your macro to open the report in
Preview mode, and then a Printout action to shoot it to the PDF printer.

However, the overwriting of an existing file with the same name is more
problematical. There is no built-in functionality to do that. The simplest
approach is to make sure the filename is not duplicated! If there really is
a dnager of duplicated file names, then you can delete the existing file(s)
in advance - but this can not be done in a macro, it requires a VBA
procedure using the Kill method. Another idea to explore would be to use
the Dir() function to check for the existence of a file with the proposed
name, and if it exists, perhaps you can modify (maybe with a SetValue
action) the report caption which ends up in the name of the new pdf file.
Sorry, I know it's not a complete answer, but hopefully give you a clue to
pursue.

Regards
Steve

--
Steve Schapel, Microsoft Access MVP

"shank" <shank[ at ]tampabay.rr.com> wrote in message
news:#SQEw58ZJHA.1532[ at ]TK2MSFTNGP03.phx.gbl...
[Quoted Text]
> What's the easiest way to print 30 reports? Even more as time passes. I'm
> assuming a macro.
>
> First issue: I need to open the report in print preview so the caption can
> build itself. Then I need to issue a print command to go to my PDF
> printer, which I have set as default. The caption becomes the PDF
> filename. That's why I need the report to open fully.
>
> OK, moving on, once the print command is issued, I see no way to
> automatically hit the OK button on the print dialog box. Then, if there
> happens to be a previous file by that name, I need another command to hit
> OK to overwrite again.
>
> How do I get the last 2 commands to hit the OK buttons on the dialog
> boxes?
>
> thanks
>

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net