Wikipedia:Reference desk/Archives/Computing/2014 June 30

= June 30 =

Simple C# printing file from VBA
Hi,

I have some VBA code that prints off an MS word document as specified by the user. However as far as I can tell, it's impossible to set the printer settings through VBA, so I'm trying another approach. Basically I need two .exe files, one which sets the default printer setting to color, and another to print in black and white. Running these from the VBA code could allow me to choose whether the file printed is in B&W or color. However I'm not a great C# programmer, could someone point me in the right direction, or give some simple sample code? Thanks 194.205.13.211 (talk) 15:16, 30 June 2014 (UTC)
 * This MSDN article describes how to use the Printer object in VBA. You shouldn't need a separate application.  Specifically, the lines you need are:

Application.Printer.ColorMode = acPRCMMonochrome

and Application.Printer.ColorMode = acPRCMColor
 * Tevildo (talk) 15:58, 30 June 2014 (UTC)