尝试将.docx文件用于合并时出错

时间:2018-10-16 19:18:19

标签: visual-studio aspose.words

使用Visual Studio,使用Merge Refactor以联机形式归档并将数据合并到Word文档中,使用.doc文件时,一切正常,但是当我尝试使用.docx文件时,我得到了出现错误后,任何帮助都会很棒!

找不到关系“ http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument”的目标 说明:执行当前Web请求期间发生未处理的异常。请查看堆栈跟踪,以获取有关错误及其在代码中起源的更多信息。

  

异常详细信息:System.InvalidOperationException:找不到   关系对象   'http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument'

     

源错误:

     

第85行:var selectedDocumentPath =   DocumentDDL.Items [DocumentDDL.SelectedIndex] .Value;

     

第86行:var ext =   System.IO.Path.GetExtension(selectedDocumentPath);

     

第87行:文档doc =新   Document(selectedDocumentPath);

     

第88行:

     

第89行:var mergeData = ConstructMergeData();

0 个答案:

没有答案