Any way to make a choose a specific printer for my program

M

Marco

Hi.

I have an idea and I already saw that in programs that is not acces based.

Is any way to allow a user to specify and save that info in txt file or
somethign about the printer that he wants as program default?

Regards,
Marco
 
A

Albert D. Kallal

You can certainly do this, and you don't even have to use a text file, just
use a table with one record and put your printer that you want in a field.


So, to save/switch, you can use:

dim strDefaultPrinter as string

' get current default printer.

strDefaultPrinter = Application.Printer.DeviceName

' switch to printer of your choice:

Set Application.Printer = Application.Printers("HP LaserJet Series II")
(Now of course you replace the above with a value from your field in your
table)

do whatever.

Swtich back.

Set Application.Printer = Application.Printers(strDefaultPrinter)

Keep in mind that if you don't set any printer for any report, it will go to
the currently set default printer, and in most cases that is what your users
want. so as a side note us that some type of invoice printer or something
else, you should probably leave this alone and let your users choose what
printer they want for their reports.
 

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