Printing to Printer

  • Thread starter Thread starter Mark Scholes
  • Start date Start date
M

Mark Scholes

Hi,
I send a spreadsheet to several people and I want them to
all print it to the same priner. I use this

Application.ActivePrinter = "\\RIMMER\HP2500CM on Ne03:"
Selection.PrintOut Copies:=1, Preview:=True,
ActivePrinter:= _
"\\RIMMER\HP2500CM on Ne03:", Collate:=True

As they have setup their printers in a different order to
me their printer will have a different 'Ne??:'

I have two questions
1. Can I get the 'Ne' number
2. Is there another way to set the active printer which
doesn't need to know the 'Ne' number

thanks MarkS
 
Mark,
Unless you get a better answer, you could loop through the possible values
of Ne, trapping for the error that's raised by an invalid printer string:

On Error Resume Next
For i=MinNeNumber to MaxNeNumber
Application.ActivePrinter = "\\RIMMER\HP2500CM on Ne0" & i & ":"
If Err.Number=0 Then Exit For
Next

NickHK
 
NickHK,

That works well if the printer is the first one, but it
does not clear the err.number. I have used this version
which checks 1 to 9.


On Error Resume Next
For i = 1 to 9
Application.ActivePrinter = "\\RIMMER\HP2500CM on Ne0"
& i & ":"
If Err.Number=0 Then Exit For
Err.Clear
Next

MarkS
 
Back
Top