changing printers on the fly

J

jb

Hello,

Can someone help me figure out how to print a PDF document out from MSAccess
2000 or 2002? I know how to create a PDF, this is not what I am looking
for. Rather, if a PDF is in C:\Temp\Foo.Pdf, I want to give a command to
just print that out to a printer of my choice.

For Word, I've used Automation and am able to print word docs. I've also
used the API call below that works great for any file type, except that I
can't get the API call to print to any printer but what looks to be my
system default printer (not the Windows Default Printer).

retval = apiShellExecute(0, "print", "c:\temp\foo.pdf", vbNullString, 0, 0)

I'm trying change the default printer on the fly in 2002 by using set
application.printer = application.printers("MyDesiredPrinter"), then running
the API call, then setting the printer back to the original default printer.
This works fine for running access reports, and I can see the default
printer has been changed if I step through the code, but the ShellExecute
command still prints to the system default printer (even if I have set a
different printer through Printers/Faxes in XP Pro as default before firing
up Access).

Any help would be appreciated. Thanks.
John
 

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

Top