GrannyM
Tue Apr 01 13:33:02 PDT 2008
That's what I needed, although I will have to say that Doug's solution of
looking for a printer with "label" in the name is much simplier. But if they
insist that I print to LPT3, now I can do so. (Of course, this means I have
to tell him he was right all along!) ;-)
Thanks!
"Jean-Guy Marcil" wrote:
> "GrannyM" wrote:
>
> > Each of our departments have a different label printer, but they are all set
> > up on lpt3. We have a label macro that is used by these departments and we
> > would like to have that macro automatically print to lpt3. Is there a way to
> > set the activeprinter to the lpt3 port without using the printer name?
>
> Basically, you need to scan the list of available printers detected by Word
> on the user machine. Then, scan the ports in that list to get the printer
> name associated with the targeted port. Store the currently active printer.
> Set the active printer to the one the code detected as being active on the
> targeted port. Print. Then reset the printer that was active before your code
> ran.
>
> See
>
http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=183
> for code on getting printer information, including the port name...