DocWright.Word 2.0.0

dotnet add package DocWright.Word --version 2.0.0
                    
NuGet\Install-Package DocWright.Word -Version 2.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DocWright.Word" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DocWright.Word" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="DocWright.Word" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add DocWright.Word --version 2.0.0
                    
#r "nuget: DocWright.Word, 2.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package DocWright.Word@2.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=DocWright.Word&version=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=DocWright.Word&version=2.0.0
                    
Install as a Cake Tool

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 by DOCPROPERTY and DOCVARIABLE fields as Word shows them
  • Charts: inserted from categories and series (InsertChart), changed through a ChartEditor (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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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/