Spire.Doc for .NET是一个专业的Word .NET库,设计用于帮助开发人员高效地开发创建、阅读、编写、转换和打印任何来自.NET( C#, VB.NET, ASP.NET)平台的Word文档文件的功能。(点击下载)
从Spire.Doc V8.12.14开始,它支持在结构列表中获取两个Word文档之间的差异。本文将向您展示如何使用Spire.Doc通过比较两个Word文档来获得差异。
C#
using Spire.Doc;
using Spire.Doc.Documents;
using Spire.Doc.Fields;
using Spire.Doc.Formatting.Revisions;
using System;
namespace GetWordDifferences
{
class Program
{
static void Main(string[] args)
{
//Load the first Word document
Document doc1 = new Document();
doc1.LoadFromFile("Sample1.docx");
//Load the second Word document
Document doc2 = new Document();
doc2.LoadFromFile("Sample2.docx");
//Compare the two Word documents
doc1.Compare(doc2, "Author");
foreach (Section sec in doc1.Sections

本文介绍如何利用Spire.Doc for .NET库在C#和VB.NET环境中比较两个Word文档的差异,该库从V8.12.14版本开始支持此功能,能高效地获取文档结构列表中的不同之处。
最低0.47元/天 解锁文章
459

被折叠的 条评论
为什么被折叠?



