B
Beeawwb
Hi everybody,
I've got an addition I'm writing into an existing module that's been working
great. We got some new print queues though, and I need to cater for these in
my code.
Essentially, if a button is pushed, I want to force the printer to be it's
printer name + an extension based on which button was pushed. So "Printer1"
becomes "Printer1-Button1"
This all works great, and I'm not having any problems with it... as long as
the printer is already installed.
If the printer is not installed, it was throwing an error and for some
reason isn't any more. I was planning on trapping for the error, and then
using that to install the printer. Doesn't seem that this will be an option
now.
So my question is 2 fold.
How do I A) Check if a printer is installed (I can check if a local printer
is installed by reading the registry, but this doesn't seem to be working for
network printers) and B) install the printer if it is not.
I have checked Jonathan West's excellent code at LogicalExpressions (I
already use a portion of this to get printer bin names, thanks!) and it seems
like I may get the information I require at
http://pubs.logicalexpressions.com/pub0009/LPMArticle.asp?ID=183 and Astrid
Zeelenberg's code at
http://www.mvps.org/word/FAQs/MacrosVBA/AvailablePrinters.htm
....
but I'm not really understanding how I can use this to check the printer
name against the array. I suppose I'd be doing a For each X in the Array,
check myprinter against X, Next X. But I've never done a For loop in an
Array. (Or... I have, but I'm running on 2 short black's and 3 hours sleep
and simply can't remember. One of the two)
Any ideas?
Thanks in advance for your expertise as always,
Bob
I've got an addition I'm writing into an existing module that's been working
great. We got some new print queues though, and I need to cater for these in
my code.
Essentially, if a button is pushed, I want to force the printer to be it's
printer name + an extension based on which button was pushed. So "Printer1"
becomes "Printer1-Button1"
This all works great, and I'm not having any problems with it... as long as
the printer is already installed.
If the printer is not installed, it was throwing an error and for some
reason isn't any more. I was planning on trapping for the error, and then
using that to install the printer. Doesn't seem that this will be an option
now.
So my question is 2 fold.
How do I A) Check if a printer is installed (I can check if a local printer
is installed by reading the registry, but this doesn't seem to be working for
network printers) and B) install the printer if it is not.
I have checked Jonathan West's excellent code at LogicalExpressions (I
already use a portion of this to get printer bin names, thanks!) and it seems
like I may get the information I require at
http://pubs.logicalexpressions.com/pub0009/LPMArticle.asp?ID=183 and Astrid
Zeelenberg's code at
http://www.mvps.org/word/FAQs/MacrosVBA/AvailablePrinters.htm
....
but I'm not really understanding how I can use this to check the printer
name against the array. I suppose I'd be doing a For each X in the Array,
check myprinter against X, Next X. But I've never done a For loop in an
Array. (Or... I have, but I'm running on 2 short black's and 3 hours sleep
and simply can't remember. One of the two)
Any ideas?
Thanks in advance for your expertise as always,
Bob