Printing to Printer

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
 
N

NickHK

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
 
M

Mark Scholes

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
 

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