Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Document library

OfficeIMO.Word

Create and edit DOCX, work with documented DOC and DOT subsets, and inspect compatibility limits from .NET without Microsoft Word.

MIT licensed No Office required Cross-platform .NET
Install dotnet add package OfficeIMO.Word
Independent render of the generated customer delivery summary: a KPI strip, a status-coloured outcomes table, a column chart, a next-steps table and a decision callout
Customer delivery summary

The downloadable DOCX and PDF are generated from one runnable Word example. The preview is an independent Poppler render of the first-party PDF result.

Download source DOCX · View source · Explore the example
C# · excerpt cut from the example source; the full file is linked above
using WordDocument document = WordDocument.Create(sourcePath);
document.Settings.FontSize = OfficeLength.Points(11);
document.Properties.Title = "Customer delivery summary";
document.PageSetup.Header.AddParagraph("Northwind Operations · Quarterly service review").FontSize = global::OfficeIMO.OfficeLength.Points(9);
document.PageSetup.Footer.AddPageNumber(includeTotalPages: true);

AddTitleBlock(document, "NORTHWIND OPERATIONS / QUARTERLY SERVICE REVIEW", "Customer delivery summary",
    "Ready for acceptance. Illustrative figures from structured project data.");
AddKpiStrip(document, ("12 of 12", "milestones accepted"), ("99.7%", "service availability"),
    ("−38%", "incidents vs. last quarter"), ("4.7 / 5", "customer rating"));

AddHeading(document, "Delivered outcomes");
AddStatusTable(document, DeliveredOutcomes, 34, 30, 18, 18);

AddHeading(document, "Incidents per week");
// 600 px (6.25 in) fits the text width of both Letter and A4 pages with 1 in margins.
document.AddChart(OfficeChartType.ColumnClustered, WeeklyIncidents, new OfficeChartOptions { Width = OfficeLength.Pixels(600), Height = OfficeLength.Pixels(220) });

AddHeading(document, "Next steps");
AddStatusTable(document, NextSteps, 40, 24, 18, 18);

WordParagraph decision = document.AddParagraph("Decision requested: approve the delivery notes so the improvement backlog can start next sprint.");
decision.ShadingFillColor = OfficeColor.Parse("EAF1FB");
decision.LineSpacingBefore = global::OfficeIMO.OfficeLength.Points(8D);
decision.Borders.LeftStyle = WordBorderStyle.Single;
decision.Borders.LeftColor = OfficeColor.Parse("235FB4");
decision.Borders.LeftSize = OfficeLength.Points(3);

Format support

Modern and legacy Microsoft Word files

Support is tracked by operation and fidelity. OfficeIMO reports approximations, visual fallbacks, preserved content, and blocked conversions instead of treating every extension as an identical promise.

Some tracked lanes are explicitly not implemented yet. The compatibility evidence names those gaps alongside supported behavior.

See full compatibility evidence
Legacy binary.DOC.DOT
Modern.DOCX.DOCM.DOTX.DOTM
Tracked contractsDOC (Word 97–2003): 33Generated from current source

Why OfficeIMO.Word?

OfficeIMO.Word helps .NET applications create, read, edit, and convert modern .docx documents and supported Word 97–2003 .doc files without COM interop or Microsoft Word. It is a good fit for reports, contracts, invoices, archive modernization, and other structured workflows where code needs control over content, layout, compatibility, and packaging.

Modern Word files use the main OfficeIMO object model. Legacy files load through the same WordDocument.Load(...) entry point, project supported content into that model, and use preflight diagnostics before native DOC output. Unsupported content is reported, preserved, converted through an explicit fallback, or blocked—it is not silently presented as native support.

Features

  • Paragraphs & text styling — fonts, sizes, colors, bold, italic, underline, strikethrough, highlight, and spacing
  • Tables with merge & split — horizontal and vertical cell merging, nested tables, 105+ built-in table styles
  • Images — insert from file path, stream, Base64 string, or URL with precise positioning and sizing
  • Headers & footers — default, first page, and odd/even with text, images, and page numbers
  • Watermarks — text and image watermarks with rotation, color, and transparency
  • Table of Contents — automatic TOC generation with configurable heading levels
  • Bookmarks & hyperlinks — internal cross-references and external links
  • Charts — pie, bar, line, area, and combo charts with series data, legends, and axis formatting
  • Content controls — checkboxes, drop-down lists, combo boxes, date pickers, and rich text controls
  • Model-driven templates — bind {{Name}} placeholders, nested repeated blocks, conditions, images, and hyperlinks while the DOCX retains layout ownership
  • Document protection — read-only, password protection, and editing restrictions
  • Before sharing — find and remove author names, comments, tracked changes, hidden text, document variables and photo locations, and check and fix accessibility. Prepare a document for sharing
  • Footnotes & endnotes — numbered references with custom formatting
  • Sections & page numbering — multiple sections with independent orientation, margins, and numbering
  • Word 97–2003 DOC and DOT — first-party import, native writing for the supported subset, bidirectional conversion, preservation-aware edits, and structured loss reports
  • Compatibility policies — require native output, prefer editability or visual fidelity, allow documented best effort, or retain the complete source for recovery

Choose the Word path

WorkflowRecommended routeWhat remains visible
Create a new report, contract, or invoiceAuthor DOCX with WordDocument.Create(...)Paragraphs, tables, sections, fields, images, charts, controls, and validation
Fill an approved DOCX templateBind a dictionary or POCO with WordTemplate.Apply(...)Replacement counts, missing values, repeated blocks, conditions, images, and links
Modernize an archiveLoad DOC and save DOCXImport warnings, preserved source metadata, and unsupported features
Deliver a legacy DOCAnalyze DOCX-to-DOC, select a compatibility mode, then convertNative, approximated, rasterized, preserved, blocked, and dropped decisions
Review and approvalLoad DOCX or supported DOC content into the normal modelComments, revisions, comparison, redline, and feature inspection
Publish to web or textAdd the focused HTML, Markdown, RTF, OpenDocument, or PDF packageResource policy and conversion diagnostics from the selected adapter

Quick start

using OfficeIMO.Word;

using var document = WordDocument.Create("Report.docx");

// Add a styled heading
var paragraph = document.AddParagraph("Quarterly Report");
paragraph.Style = WordParagraphStyles.Heading1;
paragraph.Color = OfficeIMO.OfficeColor.DarkBlue;

// Add body text
document.AddParagraph("This report summarizes key metrics for Q4 2025.")
    .SetBold(false)
    .SetFontSize(12);

// Add a table
var table = document.AddTable(4, 3);
table.Rows[0].Cells[0].Paragraphs[0].Text = "Region";
table.Rows[0].Cells[1].Paragraphs[0].Text = "Revenue";
table.Rows[0].Cells[2].Paragraphs[0].Text = "Growth";
table.Rows[1].Cells[0].Paragraphs[0].Text = "North America";
table.Rows[1].Cells[1].Paragraphs[0].Text = "$4.2M";
table.Rows[1].Cells[2].Paragraphs[0].Text = "+12%";
table.Rows[2].Cells[0].Paragraphs[0].Text = "Europe";
table.Rows[2].Cells[1].Paragraphs[0].Text = "$3.1M";
table.Rows[2].Cells[2].Paragraphs[0].Text = "+8%";
table.Rows[3].Cells[0].Paragraphs[0].Text = "Asia Pacific";
table.Rows[3].Cells[1].Paragraphs[0].Text = "$2.7M";
table.Rows[3].Cells[2].Paragraphs[0].Text = "+15%";
table.Style = WordTableStyle.GridTable4Accent1;

document.Save();

Convert DOC and DOCX

File-to-file conversion uses the OfficeIMO package.

using OfficeIMO;
using OfficeIMO.Word;

// The normal loader detects the legacy DOC container.
using WordDocument legacy = WordDocument.Load("contract.doc");
legacy.Save("contract-modernized.docx");

// Bidirectional conversion uses the same import and save preflight.
OfficeConverter.Convert("contract.doc", "contract.docx");
OfficeConverter.Convert("contract.docx", "contract.doc");

Use OfficeConverter.Analyze(...) before writing when your application needs to reject approximation, static visual fallback, source retention, or known loss.

Compatibility

Target FrameworkSupported
.NET 10.0Yes
.NET 8.0Yes
.NET Standard 2.0Yes
.NET Framework 4.7.2Yes

OfficeIMO.Word runs on Windows, Linux, and macOS. It creates and edits modern Word packages and supports first-party DOC/DOT import, native writing for the documented subset, and bidirectional conversion. The format compatibility dashboard is the concise public view; the repository contract records every tracked feature and limitation.

GuideDescription
Word documentationStart with the package overview and document structure.
DOCX templatesBind models to Word-authored layouts with plain markers, merge fields, or content controls.
Tables guideBuild styled tables, merged cells, and richer layouts.
Market readinessSee the current non-PDF readiness snapshot for templates, review workflows, conversion proof, and showcase work.
DOC and DOCX compatibilityCheck formats, conversion directions, tracked behaviors, and fidelity states.
Word to HTMLConvert generated documents to and from HTML.
PSWriteOffice Word cmdletsAutomate Word output from PowerShell scripts.
PackageDescription
OfficeIMO.Word.HtmlConvert Word documents to and from HTML
OfficeIMO.Word.MarkdownConvert Word documents to and from Markdown
OfficeIMO.Word.PdfExport Word documents to PDF
OfficeIMO.Word.GoogleDocsTranslate Word documents to and from Google Docs

Same engine, other surfaces

Use OfficeIMO another way

Next step

Turn the package into a working document.

Follow a focused guide and inspect the API reference for this package.

Example source