active network printer

J

Joel Allen

Hello,

I use this code to set the active printer.

objDoc.Application.ActivePrinter



It works if the printer is local, but not if it's a network printer. Is the
code different for network printer?


Thanks for your help,

Joel
 
J

Jean-Guy Marcil

Joel Allen was telling us:
Joel Allen nous racontait que :
Hello,

I use this code to set the active printer.

objDoc.Application.ActivePrinter



It works if the printer is local, but not if it's a network printer. Is
the code different for network printer?


See:

Controlling the Printer from Word VBA
Part 1: Using VBA to Select the Paper Tray
http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=101

Controlling the Printer from Word VBA
Part 2: Using VBA to control Duplex, Color Mode and Print Quality
http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=116

Controlling the Printer from Word VBA
Part 3: Dealing with Different Paper Sizes
http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=132

Controlling the Printer from Word VBA
Part 4: Getting printer driver details
http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=183

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
J

Joel Allen

Hello Jean-Guy,

Thanks for your reply, but I didn't see anything about a network printer in
these articles. Can you please help me further?

Thanks,
Joel
 
J

Jean-Guy Marcil

Joel Allen was telling us:
Joel Allen nous racontait que :
Hello Jean-Guy,

Thanks for your reply, but I didn't see anything about a network
printer in these articles. Can you please help me further?

Did you look at this one:
Controlling the Printer from Word VBA
Part 4: Getting printer driver details
http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=183

What code are you using?

On a network. you have to specify the server and usually the port name as
well.
The page I cited above will help you make sense of this.

For example, on a local network, the following code sets the active printer:

Application.ActivePrinter = "HP DeskJet 930C on SALON on NE01:"

A quick way to figure out what to write between the quotes is to use this
code after setting the target active printer manually:

MsgBox "The name of the active printer is " & ActivePrinter

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
J

Joel Allen

Thank you! That worked perfectly.

Joel

Jean-Guy Marcil said:
Joel Allen was telling us:
Joel Allen nous racontait que :


Did you look at this one:
Controlling the Printer from Word VBA
Part 4: Getting printer driver details
http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=183

What code are you using?

On a network. you have to specify the server and usually the port name as
well.
The page I cited above will help you make sense of this.

For example, on a local network, the following code sets the active
printer:

Application.ActivePrinter = "HP DeskJet 930C on SALON on NE01:"

A quick way to figure out what to write between the quotes is to use this
code after setting the target active printer manually:

MsgBox "The name of the active printer is " & ActivePrinter

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

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