我需要比较两个office文档,在这种情况下是两个word文档并提供差异,这有点类似于SVN中显示的内容.不是那么大,但至少能够突出差异.
我尝试使用办公室COM DLL,并得到了这个...
object fileToOpen = (object)@"D:\doc1.docx";
string fileToCompare = @"D:\doc2.docx";
WRD.Application WA = new WRD.Application();
Document wordDoc = null;
wordDoc = WA.Documents.Open(ref fileToOpen, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
wordDoc.Compare(fileToCompare, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
Run Code Online (Sandbox Code Playgroud)
有关如何进一步处理的任何提示?这将是一个具有大量点击的Web应用程序.使用office com对象是正确的方法,还是有其他我可以看的东西?
| 归档时间: |
|
| 查看次数: |
9602 次 |
| 最近记录: |