我正在使用Microsoft Office Document Image Writer将word文档转换为tiff文件。问题是,它一直保存一个文件,它在预览窗口中显示它。所以我想知道是否有办法阻止它显示这个预览窗口?
这是代码:
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);
答案 0 :(得分:0)
我没有找到以编程方式执行此操作的方法,但是一次性取消选中“另存为”对话框中的“查看文档图像”。