DocWright.Word
2.0.0
dotnet add package DocWright.Word --version 2.0.0
NuGet\Install-Package DocWright.Word -Version 2.0.0
<PackageReference Include="DocWright.Word" Version="2.0.0" />
<PackageVersion Include="DocWright.Word" Version="2.0.0" />
<PackageReference Include="DocWright.Word" />
paket add DocWright.Word --version 2.0.0
#r "nuget: DocWright.Word, 2.0.0"
#:package DocWright.Word@2.0.0
#addin nuget:?package=DocWright.Word&version=2.0.0
#tool nuget:?package=DocWright.Word&version=2.0.0
DocWright.Word
The mutable document model for DocWright, plus the editing API: sections, paragraphs, runs, tables, styles, numbering, theme, tracked changes, content controls, form fields and lossless round-trip preservation.
Install
dotnet add package DocWright.Word
Most people should install DocWright
instead — it includes this package and gives you the Load and Save calls that put a
document in your hands.
Editing a document
using DocWright;
using DocWright.Word;
using DocWright.Word.Editing;
var converter = new DocWrightConverter();
using WordDocument document = converter.Load(File.OpenRead("template.docx"));
// Find and replace, across runs and formatting boundaries
document.ReplaceText("Contoso", "Fabrikam");
// {{placeholder}} template filling
document.ReplacePlaceholders(new Dictionary<string, object?>
{
["CustomerName"] = "Fabrikam Inc.",
["Total"] = 1499.00m,
});
using FileStream output = File.Create("filled.docx");
converter.Save(document, output);
What the editing API covers
- Find and replace, including matches split across runs
{{placeholder}}filling with a key-value map, scoped to any node — a single table row, a header, or the whole document- Bookmarks and ranges
- Merge and split documents
- Content controls and legacy form fields; form fields inserted (
InsertTextFormField,InsertCheckBoxFormField,InsertDropDownFormField), changed, renamed and removed as Word writes them - Fields and field results
- Tracked changes: accept, reject, enumerate
- Custom-XML data binding
- Document properties: the core set (title, author, dates, revision, status and the rest), custom properties of
each kind Word offers (
SetCustomProperty,GetCustomProperty,RemoveCustomProperty) and document variables (SetDocumentVariable), shown byDOCPROPERTYandDOCVARIABLEfields as Word shows them - Charts: inserted from categories and series (
InsertChart), changed through aChartEditor(title, kind, series, values, axes, legend, labels, colours) and removed, the chart part edited in place
Sparse by design
Formatting is stored sparsely — the model records whether a value was set explicitly or inherited. That is what lets a save write back only what the source actually had, instead of flattening every inherited property into an explicit one.
Lossless preservation
Markup the model does not represent is preserved opaquely rather than dropped, and wins on write. Load-and-save keeps features this library has no opinion about.
Requirements
.NET Framework 4.8, .NET Standard 2.0, .NET 8.0 or .NET 10.0.
Documentation
📖 DocWright documentation ·
Create a document with the DOM ·
Find and replace ·
Forms and content controls ·
API reference: DocWright.Word
Contact
Questions, support or licensing: salwan@albahadly.com · www.albahadly.com
License
MIT.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 is compatible. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.8
- DocWright.Core (>= 2.0.0)
- DocWright.Cryptography (>= 2.0.0)
- Microsoft.Bcl.HashCode (>= 1.1.1)
- System.Buffers (>= 4.6.1)
- System.Memory (>= 4.6.3)
- System.Runtime.CompilerServices.Unsafe (>= 6.1.2)
-
.NETStandard 2.0
- DocWright.Core (>= 2.0.0)
- DocWright.Cryptography (>= 2.0.0)
- Microsoft.Bcl.HashCode (>= 1.1.1)
- System.Buffers (>= 4.6.1)
- System.Memory (>= 4.6.3)
- System.Runtime.CompilerServices.Unsafe (>= 6.1.2)
-
net10.0
- DocWright.Core (>= 2.0.0)
- DocWright.Cryptography (>= 2.0.0)
-
net8.0
- DocWright.Core (>= 2.0.0)
- DocWright.Cryptography (>= 2.0.0)
NuGet packages (14)
Showing the top 5 NuGet packages that depend on DocWright.Word:
| Package | Downloads |
|---|---|
|
DocWright
Convert, render and edit Word documents in .NET — no Microsoft Word, no Office interop, no native dependencies. Reads DOCX and legacy DOC, renders to PDF and PNG/JPEG, saves to DOCX, HTML, Markdown, RTF, text, ODT, EPUB and RDL, rasterizes existing PDFs, and edits documents through a mutable model with find/replace, placeholder filling, content controls and tracked changes. This is the main package: install it for the whole pipeline. |
|
|
DocWright.Reporting.Export
File exports for DocWright reports, lowered from the paginated page model: DOCX (a fixed-layout positioning grid, one section per report page, or a flow document), CSV (the report's data with the scope rules SSRS applies, not a picture of the page) and plain text. The page model is the same one the PDF and image renderers draw, so every export paginates identically. |
|
|
DocWright.Word.Compare
Compare two Word documents with DocWright and get one document back carrying the differences as real tracked changes — insertions, deletions and formatting changes — that review in Word like any other compared document. Paragraph alignment, move detection, and word- or character-level granularity. Deterministic: author and timestamp are values you supply, never read from the clock. |
|
|
DocWright.Word.Docx
DOCX reader and writer for DocWright: single-pass WordprocessingML parsing into the mutable document model, and a writer that round-trips losslessly by preserving markup it does not model rather than dropping it. The only DocWright package that depends on DocumentFormat.OpenXml. Most users should install the DocWright package instead, which includes this one. |
|
|
DocWright.Word.Epub
EPUB 3 export for DocWright: a dependency-free packager producing a conforming, reader-ready OCF container with an OPF package document, an EPUB 3 navigation document and one XHTML content document per chapter, validated against EPUBCheck. Export only — there is no EPUB reader. Most users should install the DocWright package instead, which includes this one. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.0.0 | 0 | 11/25/2026 |
Guides, tutorials and API reference: https://docs.albahadly.com/docwright/