2013-11-04, 09:12 #1
- Join Date
- Jan 2001
- UK, Surrey
- Thanked 0 Times in 0 Posts
Select color / colour or B&W printing in vba macro
I have long had macro buttons in my Word Quick Access Toolbar (and before that in menus) to allow me to quickly print a document in black and white, or in colour. Something like this:
' PrintBW Macro
'Save current printer
Dim sCurrentPrinterStr As String
sCurrentPrinterStr = ActivePrinter
'Set printer to black and white printer
ActivePrinter = "\\sethpafil006\HP Laserjet 4350 DTN"
Application.PrintOut FileName:="", Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentWithMarkup, Copies:=1, Pages:="", PageType:= _
wdPrintAllPages, Collate:=True, Background:=True, PrintToFile:=False, _
PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _
'Reset printer to original setting
ActivePrinter = sCurrentPrinterStr
This macro was assigned to an icon, next to another similar macro/icon combination for printing using the colour printer.
I've now moved to an office with a single Kyocera TASKalfa 400ci KX printer. This can be set to print in B&W, or in colour - the default is black and white (to save money).
I have tried recording a macro to select colour printing, and print a document; but the mouse clicks used to select colour printing do not seem to be recorded in the macro.
Google has not been my friend - perhaps it would help if I could work out what to search for, but searches so far have not got any useful hits.
Can anybody suggest how to set the printer to print in B&W or in colour using VBA?
Subscribe to our Windows Secrets Newsletter - It's Free!
Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!
+ Get this BONUS — free!
Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!
2013-11-05, 00:29 #2
- Join Date
- May 2002
- Canberra, Australian Capital Territory, Australia
- Thanked 175 Times in 161 Posts
It might be worthwhile checking whether setting 'Options.PrintDraft = True' kills the colour output.Cheers,
[MS MVP - Word]