【问题标题】:Can't save word as pdf无法将word另存为pdf
【发布时间】:2012-06-19 11:07:57
【问题描述】:

我制作了一个 Word 插件,它允许用户单击按钮、选择文件名并保存为 pdf 文件。

但很多时候,用户会收到此错误: System.Runtime.InteropServices.COMException (0x80004005):(大致翻译自丹麦语:)文件被另一个程序或用户使用。

即使文件名不存在。

这是我的代码:

If dlgSaveAsPDF.ShowDialog = System.Windows.Forms.DialogResult.OK Then
    With Globals.ThisAddIn.Application
        .ActiveDocument.ExportAsFixedFormat(OutputFileName:= _
     dlgSaveAsPDF.FileName, ExportFormat:= _
     wdExportFormatPDF, OpenAfterExport:=False, OptimizeFor:= _
     wdExportOptimizeForPrint, Range:=wdExportAllDocument, _
     Item:=wdExportDocumentWithMarkup, IncludeDocProps:=False, KeepIRM:=True, _
     CreateBookmarks:=wdExportCreateNoBookmarks, DocStructureTags:=True, _
     BitmapMissingFonts:=True, UseISO19005_1:=False)
    End With
    System.Diagnostics.Process.Start(dlgSaveAsPDF.FileName)
End If

文件永远不会被保存。

【问题讨论】:

  • 确定文件名有 pdf 扩展名,并且不保留其 doc(x) 扩展名?

标签: .net pdf ms-word com-interop word-automation


【解决方案1】:

这似乎是卡巴斯基的问题...

http://support.kaspersky.com/faq/?qid=208280046

按照faq后,没有出现错误。

不明白为什么卡巴斯基还没有解决这个问题……嗯。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-05-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-05-17
    • 1970-01-01
    • 2016-02-21
    • 2012-08-16
    相关资源
    最近更新 更多