Tracked changes in a DOCX file are a feature that allows you to suggest and review changes in a document. This is particularly useful for collaborative work, as it helps you keep track of who made which changes and when.
Tracked changes can be created by typing in reviewing mode. They may also be accepted or rejected from the reviewing panel while in reviewing mode or by clicking on the tracked change in editing mode.
Get Tracked Changes Using API
Tracked changes can be retrieved by using the getTrackedChanges API.
Tracked changes will be represented by an array of TrackedChange objects.
JSON
1{
2 "id": "number - The unique identifier of the object",
3 "type": "'inserted'|'deleted' - The type of tracked change",
4 "author": "string - The author of the tracked change",
5 "date": "Date - The date of the tracked change",
6 "plainText": "string - The content of the tracked change to be inserted or deleted",
7 "getPagePositions": "function - Returns a promise that resolves to an array of objects containing {pageNumber: number, rect: Core.Math.Rect} for each annotation related to the tracked change"
8}
Tracked Changes Updated Event
Updates to tracked changes may be listened for by the trackedChangesUpdated event on the document. This will be triggered when a tracked change is added, modified, or deleted.
Tracked changes can be programmatically accepted or rejected by calling the following APIs using the trackedChangeId retrieved from the list of tracked changes.
The page position of a tracked change can be retrieved by calling getPagePositions on a single tracked change. This is useful for knowing where the tracked change markup appears in the document at the time of calling this method.