Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ActivePrinter - How to find out active printer name

Status
Not open for further replies.

ShellBell

Programmer
Oct 29, 2003
6
US
We have global macros set up in Word to change the page setup so the paper pulls from the correct paper tray depending on what print driver the user is using. We've always used the ActivePrinter property (see below) to see what print driver the user is using. The problem now arises that the ActivePrinter will be named all sorts of names depending on the user name, user group, what Citrix Server they're hitting, etc. so I now what to use the File/Print/Type to capture what print driver the user is using, as it's written the same way that the ActivePrinter use to be written. Is this possible? What is the code?

GLOBAL MACROS USED NOW

'---- CHANGE THE PAPER TRAYS IN THE PAGE SETUP ACCORDING
'---- TO THE PRINT DRIVER THE USER IS USING
'---- SELECT THE UPPER TRAY (OR TRAY 2) FOR THE FIRST PAGE
'---- & LOWER TRAY (OR TRAY 3) FOR THE REMAINDER PAGES
If ActivePrinter = "HP LaserJet 4" Then
With ActiveDocument.PageSetup
.FirstPageTray = wdPrinterLowerBin
.OtherPagesTray = wdPrinterLargeCapacityBin
End With
ElseIf ActivePrinter = "HP LaserJet 4000 Series PCL 5e" Then
With ActiveDocument.PageSetup
.FirstPageTray = wdPrinterLowerBin
.OtherPagesTray = wdPrinterLargeCapacityBin
End With
ElseIf ActivePrinter = "HP LaserJet 4250 PCL 5e" Then
With ActiveDocument.PageSetup
.FirstPageTray = 260
.OtherPagesTray = 261
End With
ElseIf ActivePrinter = "HP LaserJet 4250 PCL 6" Then
With ActiveDocument.PageSetup
.FirstPageTray = 261
.OtherPagesTray = 260
End With
ElseIf ActivePrinter = "HP Universal Printing PCL 5" Then
With ActiveDocument.PageSetup
.FirstPageTray = 270
.OtherPagesTray = 269
End With
End If


What is the code to use for File/Print/Type in lieu of ActivePrinter to find out what print driver the user is using?

Thanks for your help.
 
You may do better with VBA questions in forum707

___________________________________________________________
If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
Steam Engine Prints
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top