我正在开发一个将word文档转换为pdf的应用程序。它工作正常,但万一文字文件损坏,并说“文件正在使用”,并给出3个选择。在该领域,申请失败了。
这就是我打开Word文档的方式。
wordDocument = wordApplication.Documents.Open(
ref paramSourceDocPath, ref paramMissing, ref paramMissing,
ref paramMissing, ref paramMissing, ref paramMissing,
ref paramMissing, ref paramMissing, ref paramMissing,
ref paramMissing, ref paramMissing, ref objWordVisible,
ref objOpenAndRepair, ref paramMissing, ref paramMissing,
ref paramMissing);
这是我导出为PDF的方式:
wordDocument.ExportAsFixedFormat(paramExportFilePath, paramExportFormat, paramOpenAfterExport, paramExportOptimizeFor, paramExportRange, paramStartPage, paramEndPage, paramExportItem, paramIncludeDocProps, paramKeepIRM, paramCreateBookmarks, paramDocStructureTags, paramBitmapMissingFonts, paramUseISO19005_1,ref paramMissing);