Programmatically Accept or Reject Tracked Changes in Word

Before a business contract is signed, the two parties involved may have modified the document several times so as the both side can reach to an agreement. In order to know who’re changing what in your Word document, you can turn on Track Changes, and Accept or Reject the changes to get the tracked changes out of the document.

This article provides an easy solution in C# to accept or reject the tracked changes. Check below code snippets:

using Spire.Doc;
using Spire.Doc.Documents;

namespace AcceptOrRejectChanges
    class Program
        static void Main(string[] args)
            Document doc = new Document();

            Section sec = doc.Sections[0];
            Paragraph para = sec.Paragraphs[0];

            //accept changes

            ////reject changes 

            doc.SaveToFile("result.docx", FileFormat.Docx);




Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s