SLOW repsonse to recognize network printers

K

kurt

Hello,

The following code is attached to a letter template for which the paper
trays must be tray 2 and 1 on the printer 10st1_HP4350. I put the first line
of code in and the NE" & i & ":" to run through all possible numbers
following the NE, since I found that each day, the NE number was changing for
the printers. This code works, but is slow, and I need to add 16 more
printer names to the code. IT IS PAINFULLY SLOW.

I need code to change trays for the active printer detected when I run the
letter template, REGARDLESS of the number following NE, and it needs to be
very fast.

Any ideas??? Thanks so much!

Kurt

For i = MinNeNumber To MaxNeNumber
Application.ActivePrinter = "\\FS01\10st1_HP4350 on NE" & i & ":"
With ActiveDocument.PageSetup
..FirstPageTray = 261
..OtherPagesTray = 262
End With
Next
 
R

Russ

Kurt,
I'm not sure what a NE number is used for? But to query for the current
active printer, you just use:
MyPrinterVariableString = Application.ActivePrinter

If you use:
MsgBox Application.ActivePrinter
or
Debug.print Application.ActivePrinter
Does it show what you want?
 

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