This sample demonstrates how to build a document review workflow for .docx files with tracked changes using TX Text Control .NET Server and ASP.NET Core.
Tracked changes are essential in industries where edits must be auditable, attributable, and reviewable:
- Legal: contract negotiations require clear redlines, author attribution, and formal accept/reject decisions.
- Healthcare: policy/procedure updates and clinical document revisions need transparent review history.
- Finance & Insurance: compliance-driven documents require controlled edit trails and approval workflows.
- Public Sector: regulated document updates must preserve accountability and revision context.
This sample focuses on making that review process usable and efficient.
The home page scans the Documents folder for .docx files and lists documents that contain tracked changes.
For each document it shows:
- file name
- unique authors (comma-separated)
- latest change timestamp (relative + exact)
- number of tracked changes
For a selected document, the review page provides:
- sortable/filterable table of changes
- pagination with selectable page size (
10,20,50,100) - single-change actions: Accept / Reject
- bulk actions with checkboxes: Accept Selected / Reject Selected
- row count and paging status
Each change can be previewed in a right-side panel:
- focused SVG snippet around the change
- full-page SVG modal
A GitHub-style heatmap visualizes author activity over time:
- activity intensity by date and author
- legend from low to high activity
- winner icon for most active author(s)
The sample uses ServerTextControl to process Word documents server-side:
- Load Word documents
textControl.Load(filePath, StreamType.WordprocessingML)
- Read tracked changes
- iterate
textControl.TrackedChanges - read metadata such as
Number,UserName,ChangeKind,Text,ChangeTime,Start,Length
- iterate
- Apply decisions (accept/reject)
textControl.TrackedChanges.Remove(trackedChange, acceptChanges)- save back to
.docxwithtextControl.Save(...)
- Create visual previews
- determine page/line via
InputPosition - generate page SVG via
GetPages()[pageNumber].GetImage(...) - crop SVG viewbox for focused preview
- determine page/line via
This provides a complete edit-review loop while keeping native Word compatibility.
-
Controllers/HomeController.cs
Loads documents, serves review data, applies change decisions, and returns preview payloads. -
Views/Home/Index.cshtml
Dashboard listing documents with tracked changes. -
Views/Home/Review.cshtml
Main review UI: heatmap, table, filtering, sorting, paging, bulk actions, preview UI. -
wwwroot/js/review.js
Client-side behavior for filtering, sorting, paging, selection, bulk submit, and preview loading. -
wwwroot/css/site.css
Styling for dashboard/review layout, heatmap, and table interactions. -
Models/*
View models and shared display helpers (for example relative timestamp formatting).
- Place
.docxfiles with tracked changes in theDocumentsfolder. - Build and run the ASP.NET Core project.
- Open the dashboard, choose a document, and review/apply changes.
- The sample is designed for review workflows; adapt persistence/audit logging as needed for production.
- For regulated environments, add authentication/authorization and immutable audit records for decisions.