# Accept or Reject Word revisions (RevisionHandler) Accept or reject native Word track-changes revisions in a DOCX file using RevisionHandler and ApplyRevisionChanges — without running a full document comparison. [GroupDocs.Comparison](https://products.groupdocs.com/comparison/net) allows you to get revisions from a Docx file format, process, and save the processing result. To take revisions from a document, accept / reject revisions, and write the processing result to the output file, follow these steps: 1. Instantiate the [RevisionHandler](https://reference.groupdocs.com/comparison/net/groupdocs.comparison.words.revision/revisionhandler) object. Specify the source document path or stream. 2. Call the [GetRevisions](https://reference.groupdocs.com/comparison/net/groupdocs.comparison.words.revision/revisionhandler/methods/getrevisions) method to get the revision list. 3. Set the [Action](https://reference.groupdocs.com/comparison/net/groupdocs.comparison.words.revision/revisioninfo/properties/action) property of the object to be changed to the [RevisionAction.Accept](https://reference.groupdocs.com/comparison/net/groupdocs.comparison.words.revision/revisionaction) or [RevisionAction.Reject](https://reference.groupdocs.com/comparison/net/groupdocs.comparison.words.revision/revisionaction) value. 4. Call the [ApplyRevisionChanges](https://reference.groupdocs.com/comparison/net/groupdocs.comparison.words.revision/revisionhandler/methods/applyrevisionchanges/index) method. Specify the created instance of the [ApplyRevisionOptions](https://reference.groupdocs.com/comparison/net/groupdocs.comparison.words.revision/applyrevisionoptions) class and path or stream of the output document, collecting changes in the revisions. You can process all changes together within one action.To handle all changes at once, follow these steps: 1. Instantiate the [RevisionHandler](https://reference.groupdocs.com/comparison/net/groupdocs.comparison.words.revision/revisionhandler) object. Specify the source document path or stream. 2. Call the [ApplyRevisionChanges](https://reference.groupdocs.com/comparison/net/groupdocs.comparison.words.revision/revisionhandler/methods/applyrevisionchanges/index) method. Specify the [ApplyRevisionOptions](https://reference.groupdocs.com/comparison/net/groupdocs.comparison.words.revision/applyrevisionoptions) object and one of the ([RevisionAction.Accept](https://reference.groupdocs.com/comparison/net/groupdocs.comparison.words.revision/revisionaction), [RevisionAction.Reject](https://reference.groupdocs.com/comparison/net/groupdocs.comparison.words.revision/revisionaction) or [RevisionAction.None](https://reference.groupdocs.com/comparison/net/groupdocs.comparison.words.revision/revisionaction)) values. The main properties of the [ApplyRevisionOptions](https://reference.groupdocs.com/comparison/net/groupdocs.comparison.words.revision/applyrevisionoptions) class are as follows: * [Changes](https://reference.groupdocs.com/comparison/net/groupdocs.comparison.words.revision/applyrevisionoptions/properties/changes) is a list of revision changes that need to be applied to the final document * [CommonHandler](https://reference.groupdocs.com/comparison/net/groupdocs.comparison.words.revision/applyrevisionoptions/fields/commonhandler) allows you to define one action to handle all revision If you do not specify the path or file to the output document for the [ApplyRevisionChanges](https://reference.groupdocs.com/comparison/net/groupdocs.comparison.words.revision/revisionhandler/methods/applyrevisionchanges) method, the source file is rewritten. The following code snippets show how to get revisions from a document, accept / reject detected revisions and save changes to the output document: ## Accept or Reject revisions from local disk {{< tabs "example1">}} {{< tab "C#" >}} ```csharp using GroupDocs.Comparison; using GroupDocs.Comparison.Options; using System.Collections.Generic; using GroupDocs.Comparison.Words.Revision; // ... using (RevisionHandler revisionHandler = new RevisionHandler( pathRevision + "Document_with_revision.docx")) { List revisionList = revisionHandler.GetRevisions(); foreach (RevisionInfo revision in revisionList) { if (revision.Type == RevisionType.Insertion) revision.Action = RevisionAction.Accept; } revisionHandler.ApplyRevisionChanges(pathRevision + "result.docx", new ApplyRevisionOptions() { Changes = revisionList }); } ``` {{< /tab >}} {{< /tabs >}} ## Accept or Reject revisions from stream {{< tabs "example2">}} {{< tab "C#" >}} ```csharp using GroupDocs.Comparison; using GroupDocs.Comparison.Options; using System.Collections.Generic; using GroupDocs.Comparison.Words.Revision; // ... using (RevisionHandler revisionHandler = new RevisionHandler( File.OpenRead("Document_with_revision.docx"))) { List revisionList = revisionHandler.GetRevisions(); foreach (RevisionInfo revision in revisionList) { if (revision.Type == RevisionType.Insertion) revision.Action = RevisionAction.Accept; } revisionHandler.ApplyRevisionChanges(pathRevision + "result.docx", new ApplyRevisionOptions() { Changes = revisionList }); } ``` {{< /tab >}} {{< /tabs >}} ## Accept or Reject all revisions {{< tabs "example3">}} {{< tab "C#" >}} ```csharp using GroupDocs.Comparison; using GroupDocs.Comparison.Options; using System.Collections.Generic; using GroupDocs.Comparison.Words.Revision; // ... using (RevisionHandler revisionHandler = new RevisionHandler( pathRevision + "Document_with_revision.docx")) { revisionHandler.ApplyRevisionChanges(pathRevision + "result.docx", new ApplyRevisionOptions() { CommonHandler = RevisionAction.Accept }); } ``` {{< /tab >}} {{< /tabs >}} ## Result of revision processing Below are the source and output files based on the code presented earlier. | Source file | Result file | | --------------------------------------------- | ---------------------------------------------------- | | ![](https://docs.groupdocs.com/comparison/net/images/revision-file.png) | ![](https://docs.groupdocs.com/comparison/net/images/result-revision-file.png) | ## See also - [Accept or reject detected changes]({{< ref "comparison/net/advanced-usage/comparison/accept-or-reject-detected-changes.md" >}}) - [Word compare options]({{< ref "comparison/net/advanced-usage/comparison/word-compare-options.md" >}}) - [Setting author of changes]({{< ref "comparison/net/advanced-usage/comparison/setting-author-of-changes.md" >}})