ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   printer options (https://www.excelbanter.com/excel-programming/315709-printer-options.html)

Kari

printer options
 
our business just purchased a new HP 4200 LaserJet printer with four paper
trays. We print documents which require three or four different colors of
paper (page 1 red, page 2 green, etc.). I am trying to set up vb code that
will select the correct trays for our empolyees automatically. Since the
print menu which allows you to do this is an hp screen, not an excel one, i
can't seem to access these options through excel vb. there doesn't seem to
be an object library i can use in references. any ideas?

kari

John Green[_4_]

printer options
 
Kari,

Theoretically, you can use SendKeys to specify the printer settings.
However, in my experience the results are messy and unreliable.

What you can do is set up a number of different print queues that point to
the same printer. These appear as if they are different printers and can be
easily specified using Application.ActivePrinter in your code. This gives
you the opportunity to set up different printing preferences for each
"virtual" printer and switch between them.

Another way I use to change printer settings is to write the output to a
file using a standard set of printing preferences and then edit the headers
in the file using VBA before sending the file to a print queue. This
requires a lot of specialist knowledge of printer codes or a lot of
investigative work, so might not be practical for most developers.

--
John Green
Sydney
Australia


"kari" wrote in message
...
our business just purchased a new HP 4200 LaserJet printer with four paper
trays. We print documents which require three or four different colors of
paper (page 1 red, page 2 green, etc.). I am trying to set up vb code

that
will select the correct trays for our empolyees automatically. Since the
print menu which allows you to do this is an hp screen, not an excel one,

i
can't seem to access these options through excel vb. there doesn't seem

to
be an object library i can use in references. any ideas?

kari




Kari

printer options
 
thanks a bunch!
kari

"John Green" wrote:

Kari,

Theoretically, you can use SendKeys to specify the printer settings.
However, in my experience the results are messy and unreliable.

What you can do is set up a number of different print queues that point to
the same printer. These appear as if they are different printers and can be
easily specified using Application.ActivePrinter in your code. This gives
you the opportunity to set up different printing preferences for each
"virtual" printer and switch between them.

Another way I use to change printer settings is to write the output to a
file using a standard set of printing preferences and then edit the headers
in the file using VBA before sending the file to a print queue. This
requires a lot of specialist knowledge of printer codes or a lot of
investigative work, so might not be practical for most developers.

--
John Green
Sydney
Australia


"kari" wrote in message
...
our business just purchased a new HP 4200 LaserJet printer with four paper
trays. We print documents which require three or four different colors of
paper (page 1 red, page 2 green, etc.). I am trying to set up vb code

that
will select the correct trays for our empolyees automatically. Since the
print menu which allows you to do this is an hp screen, not an excel one,

i
can't seem to access these options through excel vb. there doesn't seem

to
be an object library i can use in references. any ideas?

kari






All times are GMT +1. The time now is 05:53 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com