Selecting A Printer With VBA

M

Minitman

Greetings,

I need to have a form printed on the same printer regardless of which
work station is trying to print it. I have 5 work stations in my LAN
each with it's own printer. Only one of these printers can print the
entire form and the print process is initiated by CommandButton1 on
sheet1 at any of the 5 work stations.

Does anyone know how to get VBA to select the correct printer when
this button is clicked?

Any help would be appreciated.

TIA

-Minitman
 
M

Mike Fogleman

I got something like this when I recorded a macro to select a printer:

ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"Symantec Fax Starter Edition on Ne00:", Collate:=True
Mike F
 
F

Frank Stone

hi
this is from my network. i don't know how your's is set up
ActiveWindow.SelectedSheets.PrintOut Copies:=1,
ActivePrinter:= _
"\\OKI-01\OKI-HP4000-01 on Ne01:", Collate:=True
regards
Frank
 
M

Minitman

Hey Mike and Frank,

Thanks for the replies, however your solutions were to specific to
your machines, but they did show me a different direction to take.

It turns out the simple answer is to use the macro recorder and just
setup the printer I needed from a work station that was not connected
to it. This gave me the following command, address and printer name
with syntax:

Application.ActivePrinter = "\\BLIND\hp deskjet 5100 series on Ne01:"

Again, thanks.

-Minitman
 
T

Tom Ogilvy

Or on a workstation that was connected, you could go to the immediate window
in the VBE and do

? Application.ActivePrinter
 

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