# TrackedChangeCollection Object

> Contains all tracked changes in the main text or another part of a document. It is a collection of objects of the type TrackedChange. A TrackedChange object represents a change of the document after someone has reworked the document. After tracking changes has been turned on with the setIsTrackChangesEnabled method, the made changes to the document will be tracked.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Object
- **Introduced:** 28.0
- **Path:** TX Text Control .NET Server > Reference > JavaScript API > TrackedChangeCollection Object
- **843 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/trackedchangecollection/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/trackedchangecollection/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/trackedchangecollection/llms-full.txt

---

### Description

Contains all tracked changes in the main text or another part of a document. It is a collection of objects of the type [TrackedChange](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/trackedchange/llms-full.txt). A [TrackedChange](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/trackedchange/llms-full.txt) object represents a change of the document after someone has reworked the document. After tracking changes has been turned on with the [setIsTrackChangesEnabled](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/setistrackchangesenabled-method/llms-full.txt) method, the made changes to the document will be tracked.

### Syntax

```javascript
TrackedChangeCollection
```

### Examples

The following example demonstrates `TrackedChangeCollection` in a practical document-editing workflow. It contains all tracked changes in the main text or another part of a document. It is a collection of objects of the type TrackedChange. A TrackedChange object represents a change of the document after someone has reworked the document. After tracking changes has been turned on with the setIsTrackChangesEnabled method, the made changes to the document will be tracked.

```javascript
function onTxError(error) {
    console.error("TX Text Control error:", error.msg);
    error.handled = true;
}

TXTextControl.textParts.getMainText(function(mainText) {
    const trackedChanges = mainText.trackedChanges;
    trackedChanges.getItem(
        function(change) {
            if (!change) {
                console.warn("No tracked change was returned.");
                return;
            }
            
            console.log("get item result:", change);
        },
        true,
        onTxError
    );
}, onTxError);
```

---

## In This Section

- [Javascript: TrackedChangeCollection.getItem Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/trackedchangecollection/getitem-method/llms-full.txt): Gets the change at the current text input position or the next or the previous change in the textflow. The search begins at the current text input position. If there is more than one change at the current input position the innermost change is returned.
- [Javascript: TrackedChangeCollection.remove Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/trackedchangecollection/remove-method/llms-full.txt): Removes a tracked change from the collection. Depending on the accept parameter the change is either accepted or rejected. When a change is rejected, inserted text is removed and deleted text is reinserted.

---

## Nearby

- **Previous:** [TrackedChangeCallback Function](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/trackedchangecallback/llms-full.txt)
- **Next:** [Javascript: TrackedChangeCollection.getItem Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/trackedchangecollection/getitem-method/llms-full.txt)
