The popular document collaboration redlining feature is very helpful when working on the same document with multiple authors specifically with legal or healthcare documents where changes need to be tracked and safely logged.
╰ TrackedChange Object
A TrackedChange object represents a change made to the document after anyone has revised the document. , you can retrieve the timestamp, the kind of the change, position, text, highlight colors and the associated author name.
The API can be also used to control the workflow of a tracked document: You can accept single changes, reject changes or retrieve information about the change. This sample shows how to accept or reject all changes programmatically by simulating the markup preview views from MS Word:
- Original: Shows the original document without any changes (reject all).
- No markup: Shows the document how it would look like with all changes (accept all).
The following screen video shows the 3 different states:
The following code includes the switch/case instruction for the different buttons in the sample:
Both Original and No markup call a function to store the current document in a variable in order to remove the changes. The Original rejects all changes and the No markup call accepts all changes:
The following method does the actual work and loops through all changes recursively in order to remove the change using the remove ╰ TX Text Control .NET Server for ASP.NET
╰ TrackedChangeCollection Object
╰ remove Method
Removes a tracked change from the collection. method:
When one of the preview states is selected, the editor is in a read only mode and switches back when Edit is clicked.
You can test this demo by downloading the sources from our GitHub repository.