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

Re: SLOW repsonse to recognize network printers by Russ

Russ
Sun Oct 21 02:41:47 PDT 2007

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?


> 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
>

--
Russ

drsmN0SPAMikleAThotmailD0Tcom.INVALID