I'm trying to persuade a VSTO Word add-in to set the printer (which will be set by defult to black-and-white) to print this document in colour prior to calling wd.ActiveDocument.PrintOut
printerSettings = new PrinterSettings();
try
{
printerSettings.PrinterName = wb.ActivePrinter;
}
catch
{
}
var pageSettings = new PageSettings(printerSettings);
//To Reset after printout
var printerColourDefaultSetting = printerSettings.DefaultPageSettings.Color;
var printColourSettings = pageSettings.Color;
if (PrinterSettings.SupportsColor) //I'd hope only one of these -but neither work
{
PrinterSettings.DefaultPageSettings.Color = true;
pageSettings.Color = true;
}
else
{
//doesn't support colour
}
object Background = true;
object Append = false;
object Range = PrintOutRange;
object To = missing;
object From = missing;
if (PrintOutRange == WdPrintOutRange.wdPrintFromTo)
{
To = LastPage.ToString(CultureInfo.InvariantCulture);
From = FirstPage.ToString(CultureInfo.InvariantCulture);
}
object Copies = NoCopies;
object PrintToFile = false;
object Collate = true;
wb.ActiveDocument.PrintOut(ref Background, ref Append, ref Range, ref missing, ref From, ref To,
ref missing,
ref Copies, ref missing, ref missing, ref PrintToFile, ref Collate,
ref missing, ref missing,
ref missing, ref missing, ref missing, ref missing);
However, with this code both the pageSettings and DefaultPageSettings settings I've set are being ignored. Any ideas how to force this into colour for a document?