Automating The Printing Process

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an application that launches a report to the screen, I then issue
the following command:

DoCmd.DoMenuItem acFormBar, acFile, 11, , acMenuVer20

which brings up the Print properties menu. What I want to do is issue the
following keystrokes somehow to populate and execute the print function:

C (To change my printer from HP to CuteWriter PDF)
<E> Enter to print and open the File name screen.
PO The Name of the File.
<E> To send the File to the Hard Disk.

Snedkeys does not work and even if it did, I would like to avoid using them.
Is there a way to control the print menu from VBA so that I can create my PDF
with no user intervention? I am using ACCESS 2003.
Thank You in advance for any help you can provide.
 
Snedkeys does not work and even if it did, I would like to avoid using

Yes, it is a VERY good idea to avoid sendkeys (if the program you launch is
not yet ready, then keystrokes are often missed...just like if you click on
word..and start typing before the blank document is displayed...keys are
often missed.

Worse, if the user bumps a mouse, or some dialog box pops up on the screen ,
then that dialog box takes the keystrokes since the focus just changed (even
bumping the mouse) can change this. Hey, lets have a "y" key get consumed by
a prompt to format your disk, or delete a file!!!.
Is there a way to control the print menu from VBA

There is a built in printer object that lets you change the printer.

However, that would solve the problem of changing the printer..but it would
NOT save the problem of entering the pdf file name.

the best solution is here

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

The above allows you to create a pdf file. Futher, you do NOT have to change
the printer. and even BETTER is that you DO NOT have to have a pdf printer
installed!!! I highly recommend the above, as it also designed to allow you
to setup the pdf file name...
 
Back
Top