OfficeIMO.Word
3.6.1
Prefix Reserved
See the version list below for details.
dotnet add package OfficeIMO.Word --version 3.6.1
NuGet\Install-Package OfficeIMO.Word -Version 3.6.1
<PackageReference Include="OfficeIMO.Word" Version="3.6.1" />
<PackageVersion Include="OfficeIMO.Word" Version="3.6.1" />
<PackageReference Include="OfficeIMO.Word" />
paket add OfficeIMO.Word --version 3.6.1
#r "nuget: OfficeIMO.Word, 3.6.1"
#:package OfficeIMO.Word@3.6.1
#addin nuget:?package=OfficeIMO.Word&version=3.6.1
#tool nuget:?package=OfficeIMO.Word&version=3.6.1
OfficeIMO.Word
Create, edit, read and save Word documents (.docx, and the supported subset of Word 97–2003 .doc) in .NET, without Microsoft Word or COM. New documents use the Modern theme for headings, body text, tables and charts. Open supported Word 6 and Word 95 files to migrate editable content to DOCX.
Install
dotnet add package OfficeIMO.Word
Add an adapter only for the conversions you need:
dotnet add package OfficeIMO.Word.Pdf # SaveAsPdf, page images
dotnet add package OfficeIMO.Word.Markdown # ToMarkdown, Markdown to Word
dotnet add package OfficeIMO.Word.Html # ToHtml, SaveAsHtml
Targets netstandard2.0, net8.0 and net10.0, plus net472 on Windows.
Create a report
using OfficeIMO;
using OfficeIMO.Word;
Milestone[] milestones = [new("Discovery", "Product", "Done"), new("Pilot", "Operations", "At risk"), new("Rollout", "IT", "Planned")];
using var document = WordDocument.Create("Status.docx");
document.AddHeading("Northwind migration", level: 1);
WordParagraph status = document.AddParagraph("Overall status: ");
status.AddText("On track").Bold = true;
document.AddHeading("Milestones", level: 2);
document.AddTable(milestones);
document.Save();
record Milestone(string Name, string Owner, string Status);
AddTable takes any IEnumerable<T>: columns come from public properties, the header row repeats on every page and numbers are right-aligned. OfficeTableOptions picks, orders and renames columns:
using OfficeIMO;
using OfficeIMO.Word;
Milestone[] milestones = [new("Discovery", "Product", "Done"), new("Pilot", "Operations", "At risk")];
using var document = WordDocument.Create("Milestones.docx");
var options = new OfficeTableOptions { Name = "Milestones" };
options.Order.AddRange(["Status", "Name"]);
options.Exclude.Add("Owner");
options.HeaderRenames["Name"] = "Milestone";
document.AddTable(milestones, options);
document.Save();
record Milestone(string Name, string Owner, string Status);
Charts
Charts are native, editable Word charts with their data in an embedded workbook. Name the category and value properties, or pass selectors with OfficeSeries:
using OfficeIMO;
using OfficeIMO.Word;
Week[] trend = [new("W1", 20, 18), new("W2", 45, 40), new("W3", 70, 66), new("W4", 92, 85)];
using var document = WordDocument.Create("Trend.docx");
document.AddHeading("Completion by week", level: 1);
document.AddChart(OfficeChartType.Line, trend, nameof(Week.Label), nameof(Week.Planned), nameof(Week.Complete));
document.AddChart(OfficeChartType.Column, trend, t => t.Label,
new OfficeChartOptions { Title = "Complete (%)", Width = OfficeLength.Centimeters(14) },
OfficeSeries.From(trend, t => t.Complete, "Complete"));
document.Save();
record Week(string Label, int Planned, int Complete);
Headers, footers and images
using OfficeIMO;
using OfficeIMO.Word;
using var document = WordDocument.Create("Letter.docx");
document.PageSetup.Header.AddParagraph("Northwind Traders");
document.PageSetup.Footer.AddParagraph("Page ").AddPageNumber(includeTotalPages: true);
document.AddImage("logo.png", width: OfficeLength.Centimeters(4));
document.AddParagraph("Dear customer,");
document.Save();
Edit an existing document
using OfficeIMO.Word;
using var document = WordDocument.Load("Status.docx");
int replaced = document.ReplaceAll("Northwind", "Contoso");
document.AddParagraph($"Updated on {DateTime.Today:d}; {replaced} replacements.");
document.Save("Status-updated.docx");
Find and ReplaceAll match ordinally and ignore case by default; pass new OfficeTextSearchOptions { MatchCase = true } or WholeWords = true to change that. Find returns a WordSearchResult with the matching paragraphs per document part and the match count, for both literal text and a Regex.
Save() writes to the path the document was created or loaded with; Save(path) writes a copy and keeps working on it. For files from outside your organization, load with WordLoadOptions.UntrustedDefaults, which rejects macros, embedded objects, ActiveX and external relationships before parsing.
For notes in FootNotes and EndNotes, TextParagraphs returns visible text per
top-level paragraph, retaining blank paragraphs, whitespace, tabs and cached
field results without field instructions. It returns a fresh text snapshot,
or null when the referenced ordinary note body cannot be resolved. Paragraphs
returns live run handles for formatting and editing: several handles can belong
to one paragraph, so its Count is not the note's paragraph count. Editing a
handle updates the note; document.Inspect() provides rich semantic snapshots.
Loading and conversion keep the source appearance. To restyle a document deliberately, apply a shared theme before saving or exporting:
using OfficeIMO;
using OfficeIMO.Word;
using OfficeIMO.Word.Pdf;
using var document = WordDocument.Load("Notes.docx");
document.ApplyTheme(OfficeTheme.Boardroom);
document.Save("Notes-styled.docx");
document.SaveAsPdf("Notes-styled.pdf");
ApplyTheme changes typography, paragraph rhythm and table decoration on the loaded model. It preserves content, semantic emphasis, code and symbol fonts, section geometry, table widths and merged cells. Table headers follow declared header rows. Word uses light-page theme defaults, including for Dark: an existing solid page background becomes white, while background images remain attached. Changed fonts, sizes and padding can change wrapping and pagination. The same themed model can use the existing PDF, HTML and image exporters.
Convert
Conversions are called on the document and return an OfficeConversionReport that lists anything the target could not carry:
using OfficeIMO;
using OfficeIMO.Markdown;
using OfficeIMO.Word;
using OfficeIMO.Word.Html;
using OfficeIMO.Word.Markdown;
using OfficeIMO.Word.Pdf;
using var document = WordDocument.Load("Status.docx");
OfficeConversionReport pdf = document.SaveAsPdf("Status.pdf");
if (pdf.HasLoss) {
foreach (OfficeDiagnostic diagnostic in pdf.Diagnostics) Console.WriteLine($"{diagnostic.Code}: {diagnostic.Message}");
}
document.SaveAsHtml("Status.html");
MarkdownDocument markdown = document.ToMarkdown();
File.WriteAllText("Status.md", markdown.ToMarkdown());
using WordDocument fromMarkdown = MarkdownDocument.Parse("# Notes\n\n- First\n- Second").ToWord();
fromMarkdown.Save("Notes.docx");
More
- Word guide: lists, styles, sections and columns, fields and tables of contents, comments and revisions, content controls, mail merge, protection and signatures, equations, legacy
.doc, image export and the full chart API. - Compatibility matrix and the generated operation contract: exactly what is supported, preserved or rejected.
- Word and HTML support, Word advanced contracts, templates and mail merge and legacy DOC compatibility.
- Examples and the migration guide.
- Adapters: OfficeIMO.Word.Pdf, Markdown, Html, Rtf, OpenDocument, GoogleDocs and IWork. PDF back to Word lives in OfficeIMO.Pdf.Word.
- PowerShell: PSWriteOffice (
New-OfficeWord).
Dependencies: the Open XML SDK and OfficeIMO.Core. Install OfficeIMO.Security only to create or validate document and VBA signatures. MIT licensed.
Generated capability summary
This table is generated from the package-neutral OfficeIMO operation catalog. The detailed source contracts remain authoritative for feature-level behavior and limitations.
| Operation | Supported | Partial | Preserved | Rejected | Unsupported | Not applicable |
|---|---|---|---|---|---|---|
| Create | 14 | 12 | 0 | 8 | 2 | 2 |
| Read | 24 | 0 | 9 | 0 | 2 | 3 |
| Edit | 12 | 0 | 22 | 3 | 0 | 1 |
| Preserve | 11 | 0 | 22 | 0 | 0 | 1 |
| Inspect | 5 | 1 | 0 | 0 | 0 | 0 |
| Validate | 4 | 0 | 0 | 0 | 0 | 2 |
| Remove | 4 | 0 | 0 | 0 | 1 | 0 |
| Convert | 31 | 27 | 0 | 8 | 0 | 1 |
The complete rows for OfficeIMO.Word are published in the generated operation contract.
| 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 is compatible. net48 was computed. 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.7.2
- DocumentFormat.OpenXml (>= 3.5.1 && < 4.0.0)
- Microsoft.Bcl.AsyncInterfaces (>= 10.0.9)
- OfficeIMO.Core (>= 3.6.1)
-
.NETStandard 2.0
- DocumentFormat.OpenXml (>= 3.5.1 && < 4.0.0)
- Microsoft.Bcl.AsyncInterfaces (>= 10.0.9)
- OfficeIMO.Core (>= 3.6.1)
-
net10.0
- DocumentFormat.OpenXml (>= 3.5.1 && < 4.0.0)
- OfficeIMO.Core (>= 3.6.1)
-
net8.0
- DocumentFormat.OpenXml (>= 3.5.1 && < 4.0.0)
- OfficeIMO.Core (>= 3.6.1)
NuGet packages (17)
Showing the top 5 NuGet packages that depend on OfficeIMO.Word:
| Package | Downloads |
|---|---|
|
OfficeIMO.Word.Pdf
PDF converter for OfficeIMO.Word - Export Word documents to PDF using the first-party OfficeIMO.Pdf engine. |
|
|
OfficeIMO.Word.Html
HTML converter for OfficeIMO.Word - Convert Word documents to/from HTML using AngleSharp |
|
|
OfficeIMO.Word.Markdown
Markdown converter for OfficeIMO.Word - Convert Word documents to/from Markdown using OfficeIMO.Markdown |
|
|
Ank.DocToolkit
Convert HTML to PDF and DOCX in C# without a browser - pure managed, no Chromium, no wkhtmltopdf, no native binaries, no LibreOffice, no Office interop. Also converts Markdown to DOCX and PDF; renders DOCX, XLSX and PPTX to PDF; exports DOCX to HTML/Markdown and XLSX to CSV/HTML; reads legacy Word 97-2003 .doc files; reads text out of a PDF; creates/edits DOCX, XLSX and PPTX; password-protects PDF, DOCX, XLSX and PPTX; and inspects and validates digital signatures in DOCX, XLSX and PPTX. Runs on Linux, Windows, macOS and arm64, and makes no network calls at runtime. |
|
|
OfficeIMO.ChartForgeX
Optional typed bridge from ChartForgeX visual artifacts to OfficeIMO Word, Excel, PowerPoint, PDF, drawing, and editable Visio surfaces. |
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on OfficeIMO.Word:
| Repository | Stars |
|---|---|
|
EvotecIT/PSWriteOffice
Moved to OfficeIMO. Development, releases, issues and pull requests: https://github.com/EvotecIT/OfficeIMO
|
| Version | Downloads | Last Updated |
|---|---|---|
| 3.6.2 | 265 | 11/18/2026 |
| 3.6.1 | 2,312 | 11/10/2026 |
| 3.6.0 | 1,222 | 11/6/2026 |
| 3.5.3 | 2,626 | 10/31/2026 |
| 3.5.2 | 4,153 | 10/24/2026 |
| 3.5.1 | 4,063 | 10/16/2026 |
| 3.4.5 | 2,409 | 10/10/2026 |
| 3.4.4 | 15,875 | 9/27/2026 |
| 3.4.3 | 5,748 | 9/12/2026 |
| 3.4.2 | 1,048 | 9/9/2026 |
| 3.4.1 | 812 | 9/7/2026 |
| 3.4.0 | 824 | 9/6/2026 |
| 3.3.0 | 807 | 9/2/2026 |
| 3.2.7 | 1,194 | 8/29/2026 |
| 3.2.6 | 7,394 | 8/22/2026 |
| 3.2.5 | 672 | 8/21/2026 |
| 3.2.4 | 832 | 8/19/2026 |
| 3.2.3 | 1,159 | 8/17/2026 |
| 3.2.2 | 4,058 | 8/13/2026 |
| 3.2.1 | 774 | 8/11/2026 |