有没有办法阻止 Microsoft Office Document Image Writer 显示预览?

发布于 2024-09-27 09:24:25 字数 1446 浏览 1 评论 0原文

我正在使用 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);

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);

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

撩人痒 2024-10-04 09:24:25

我没有找到一种编程方法来执行此操作,但一次性从“另存为”对话框中取消选中“查看文档图像”。

  • 打开任意Word文档;这是一个测试文档,之后您可以将其丢弃。
  • 选择文件->打印。
  • 记住打印机的名称,您将再次需要它。
  • 从“名称”下拉列表中,选择“Microsoft Office Image Writer”。
  • 单击属性按钮。
  • 选择高级选项卡。
  • 选择 TIFF - 单色传真选项。
  • 单击“确定”,然后再次单击“确定”。
  • (可选)为要保存的文件选择一个新位置。
  • 取消单击“查看文档图像”。
  • 单击“保存”。这是一个垃圾文件,之后可以扔掉。
  • 从同一 Word 文档中选择“文件”->“打印”
  • 从“名称”下拉列表中,选择步骤 c 中记住的打印机名称。
  • 单击“确定”。这是垃圾印刷品,之后可以扔掉。

I didn't find a programmatic way of doing this, but on a one time basis, uncheck View Document Image from the Save As dialog.

  • Open any Word document; it's a test document and you can trash it afterwards.
  • Select File->Print.
  • Remember the name of the printer, you'll need it again.
  • From the Name drop down list, select Microsoft Office Image Writer.
  • Click the Properties button.
  • Select the Advanced tab.
  • Select the TIFF - Monochrome Fax option.
  • Click OK and OK again.
  • Optionally select a new location for the file that is about to be saved.
  • Unclick View Document Image.
  • Click Save. This is a trash file and can be thrown away afterwards.
  • Select File->Print from the same Word document
  • From the Name drop down list, select the name of the printer from remembered from step c.
  • Click OK. This is a trash print and can be thrown away afterwards.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文