I am using Microsoft Office Document Image Writer to convert a word document to a tiff file. The problem is that ever time it saves a file it shows it in a preview window. So I like to know if there's a way to prevent it from showing this preview window?
here's the code :
const string printerName = "Microsoft Office Document Image Writer";
var app = new ApplicationClass();
object filename = "C:\\ad.docx";
docName = "ad.docx";
var missing = Type.Missing;
object trueValue = true;
object falseValue = false;
var doc = app.Documents.Open(ref filename, ref missing, ref trueValue, ref falseValue, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing);
app.ActivePrinter = printerName;
fileSystemWatcher.Created += FileCreated;
fileSystemWatcher.EnableRaisingEvents = true;
object outputFileName = "c:\\Result\\ad.tif";
key = outputFileName.ToString();
_wait = new AutoResetEvent(false);
doc.PrintOut(ref trueValue, ref falseValue, ref missing, ref outputFileName, ref missing, ref missing,
ref missing, ref missing, ref missing, ref missing, ref trueValue, ref missing, ref missing,
ref missing, ref missing, ref missing, ref missing, ref missing);
_wait.WaitOne();
doc.Close(ref missing, ref missing, ref missing);
app.Quit(ref missing, ref missing, ref missing);