Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / October 2006

Tip: Looking for answers? Try searching our database.

active network printer

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Joel Allen - 29 Sep 2006 22:46 GMT
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
Jean-Guy Marcil - 30 Sep 2006 01:56 GMT
Joel Allen was telling us:
Joel Allen nous racontait que :

> Hello,
>
[quoted text clipped - 4 lines]
> 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

Signature

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org

Joel Allen - 03 Oct 2006 00:26 GMT
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

> Joel Allen was telling us:
> Joel Allen nous racontait que :
[quoted text clipped - 25 lines]
> Part 4: Getting printer driver details
> http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=183
Jean-Guy Marcil - 03 Oct 2006 03:44 GMT
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

Signature

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org

Joel Allen - 03 Oct 2006 17:28 GMT
Thank you!  That worked perfectly.

Joel

> Joel Allen was telling us:
> Joel Allen nous racontait que :
[quoted text clipped - 24 lines]
>
>    MsgBox "The name of the active printer is " & ActivePrinter
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.