AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Devexpress Office File Api Word Processing

skill-devexpress-agent-skills-devexpress-office-file-api-word-processing · by DevExpress

Build .NET applications with the DevExpress Word Processing Document API for creating, reading, modifying, and exporting Word documents programmatically without Microsoft Office. Use when working with .docx, .doc, .rtf, .odt, .txt documents, paragraphs, tables, styles, mail merge, headers/footers, fields, track changes, or document conversion. Also use when someone mentions "DevExpress Word", "Wo…

No reviews yet
0 installs
36 views
0.0% view→install

Install

$ agentstack add skill-devexpress-agent-skills-devexpress-office-file-api-word-processing

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-devexpress-agent-skills-devexpress-office-file-api-word-processing)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
3mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Devexpress Office File Api Word Processing? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

DevExpress Word Processing Document API

The Word Processing Document API is a non-visual .NET library for creating, loading, editing, and exporting Word processing documents programmatically — without requiring Microsoft Office. It supports .docx, .doc, .rtf, .odt, .txt, .html, .mht, and WordML formats and can export to PDF, HTML, and image series. The primary entry point is RichEditDocumentServer, a server-side class suitable for console apps, ASP.NET Core, Blazor, MAUI, and background services.

When to Use This Skill

Use this skill when you need to:

  • Create Word documents (.docx, .rtf, .odt) programmatically without Microsoft Office
  • Load and modify existing .docx / .doc / .rtf files in .NET
  • Apply character and paragraph formatting, styles, or linked styles
  • Build tables, lists, hyperlinks, and bookmarks in code
  • Add headers, footers, footnotes, endnotes, or watermarks
  • Perform mail merge — generate personalized letters, invoices, or reports from a data source
  • Search and replace text, including regex-based search
  • Export Word documents to PDF, HTML, or a series of page images
  • Compare two documents and produce a revision-marked result
  • Accept or reject tracked changes programmatically
  • Merge or split Word documents
  • Work with fields (MERGEFIELD, TOC, HYPERLINK, PAGE, DATE, IF, etc.)
  • Protect documents with passwords or restrict editing permissions

Prerequisites & Installation

NuGet Packages

| Package | Purpose | |---------|---------| | DevExpress.Document.Processor | Core Word processing (create, load, edit, save, mail merge) |

.NET (6/7/8+)

dotnet add package DevExpress.Document.Processor

.NET Framework (4.6.2+)

Install-Package DevExpress.Document.Processor

Alternatively, reference these assemblies from the DevExpress Unified Installer: DevExpress.Data, DevExpress.Drawing, DevExpress.Office.Core, DevExpress.RichEdit.Core, DevExpress.Printing.Core, DevExpress.Pdf.Core.

Important: All DevExpress packages in a project must share the same version number. A valid DevExpress license is required.

Before You Start — Ask the Developer

Before generating code, ask these questions to avoid rework:

General Questions

  1. Target framework: Are you using .NET 8+, .NET 6/7, or .NET Framework 4.x?
  2. New or existing project?: Are you creating a new project or adding to an existing one?
  3. Hosting model: Console app, ASP.NET Core, Blazor, MAUI, WinForms, WPF, or something else?

Word Processing–Specific Questions

  1. Operation type: Create new / read existing / modify / convert / mail merge?
  2. Features needed: Paragraphs & styles / tables / fields / headers-footers / mail merge / search-replace / track changes / shapes & images?
  3. Output format: .docx / .rtf / .odt / PDF / HTML / image series?

> Rule: If the developer's answer is ambiguous or missing, ask before generating code. Do not guess.

Component Overview

The Word Processing Document API provides:

  • Document lifecycle: Create, load, save, and dispose of documents (RichEditDocumentServer, Document)
  • Content authoring: Paragraphs, text runs, tables, lists, shapes, images, comments (Document, Paragraph, Table, Shape)
  • Formatting: Character properties, paragraph properties, styles, linked styles, theme fonts (CharacterProperties, ParagraphProperties, ParagraphStyle, CharacterStyle)
  • Fields & merge: 25+ field types, mail merge with plain and master-detail data sources (Field, MailMergeOptions)
  • Output: PDF export, HTML export/import, RTF, ODT, printing, image series (RichEditDocumentServer.ExportToPdf, SaveDocument)
  • Review features: Track changes, compare documents, accept/reject revisions (Document.TrackChanges, Document.Revisions)

Core Entry Point

using DevExpress.XtraRichEdit;
using DevExpress.XtraRichEdit.API.Native;

// Create a new document
using (var server = new RichEditDocumentServer())
{
    Document doc = server.Document;
    doc.AppendText("Hello, World!");
    server.SaveDocument("output.docx", DocumentFormat.Docx);
}

// Load and modify an existing document
using (var server = new RichEditDocumentServer())
{
    server.LoadDocument("input.docx", DocumentFormat.Docx);
    Document doc = server.Document;
    // ... make changes ...
    server.SaveDocument("output.docx", DocumentFormat.Docx);
}

Documentation & Navigation Guide

Getting Started

Refer to [references/getting-started.md](references/getting-started.md)

When you need to:

  • Set up the Word Processing Document API for the first time
  • Understand NuGet packages and assembly references for .NET
  • Create your first Word document
  • Load, modify, and save documents in different formats
  • See a complete working example

Getting Started — .NET Framework

Refer to [references/getting-started-dotnet-fw.md](references/getting-started-dotnet-fw.md)

When you need to:

  • Target .NET Framework 4.6.2+ specifically
  • Reference DevExpress assemblies instead of NuGet packages
  • Understand .NET Framework–specific differences and limitations

Text and Paragraphs

Refer to [references/text-and-paragraphs.md](references/text-and-paragraphs.md)

When you need to:

  • Add, insert, or delete text and paragraphs
  • Apply direct character formatting (font, size, color, bold, italic, underline)
  • Apply paragraph formatting (alignment, indents, spacing, tab stops)
  • Create and apply paragraph and character styles, including linked styles
  • Set default document formatting
  • Work with lists (bulleted, numbered, multilevel)
  • Add hyperlinks, bookmarks, and comments

Tables

Refer to [references/tables.md](references/tables.md)

When you need to:

  • Create tables in a document
  • Add, remove, or resize rows and columns
  • Apply table styles and cell formatting
  • Merge or split cells
  • Set fixed-width columns or AutoFit behavior
  • Configure repeat header rows across pages

Mail Merge

Refer to [references/mail-merge.md](references/mail-merge.md)

When you need to:

  • Create or load a mail merge template
  • Add MERGEFIELD, DOCVARIABLE, or INCLUDEPICTURE fields to a template
  • Connect a data source (DataTable, DataSet, collection, database)
  • Execute a mail merge and save or stream the result
  • Build master-detail reports with table regions
  • Insert images from a database during merge

Export

Refer to [references/export.md](references/export.md)

When you need to:

  • Export a Word document to PDF with options (page range, PDF/A, PDF/UA-2, password)
  • Export to HTML with embedded or external images
  • Save as RTF, ODT, plain text, or other formats
  • Export document pages as images
  • Print a document with the default or custom printer settings
  • Configure print options (page background, comment display)

Safe Document Processing (v26.1+)

Refer to [references/safe-document-processing.md](references/safe-document-processing.md)

When you need to:

  • Reject oversized or structurally abnormal documents before full parsing (DoS protection)
  • Strip macros, OLE objects, ActiveX, external images, and dangerous hyperlinks on load
  • Remove personal metadata, revision history, and hidden content before sharing (GDPR, HIPAA, SOX)
  • Inspect a document to discover what sensitive content it contains before sanitizing

Advanced Features

Refer to [references/advanced-features.md](references/advanced-features.md)

When you need to:

  • Work with fields (TOC, PAGE, NUMPAGES, DATE, IF, HYPERLINK, MERGEFIELD, etc.)
  • Use content controls or custom XML parts
  • Enable and manage track changes
  • Compare two documents and produce a diff
  • Merge multiple documents or split a document by sections
  • Search and replace text, including regex patterns
  • Add watermarks, hyphenation settings, or VBA macro handling

Document Security

Refer to [references/document-security.md](references/document-security.md)

When you need to:

  • Password-protect a document and restrict editing modes
  • Encrypt a DOCX file with AES-256 (strong) encryption on save
  • Open an existing password-encrypted file
  • Grant specific users or groups permission to edit named document ranges (range permissions)
  • Lock individual sections from modification

Shapes and Images

Refer to [references/shapes-and-images.md](references/shapes-and-images.md)

When you need to:

  • Insert geometric shapes (rectangles, ellipses, arrows, etc.) into a document
  • Add pictures from a file, stream, or URI
  • Create and populate text boxes
  • Group shapes or ungroup an existing shape group
  • Embed charts (column, bar, line, Pareto, combination, etc.)
  • Control shape position, size, rotation, text wrapping, and accessibility alt text
  • Remove shapes or filter shapes by type

Page Setup

Refer to [references/page-setup.md](references/page-setup.md)

When you need to:

  • Set page size (paper kind) or switch between portrait and landscape
  • Change page margins for a section
  • Insert section breaks (next page, continuous, even/odd page, column)
  • Configure page numbering per section (start number, format, continuation)
  • Set up a multi-column layout
  • Add page breaks within a section

Digital Signing

> ⚠️ This feature requires DevExpress v26.1+. Reference to be added in a future update.

Quick Start Example

using DevExpress.XtraRichEdit;
using DevExpress.XtraRichEdit.API.Native;
using System.Drawing;

using (var server = new RichEditDocumentServer())
{
    Document doc = server.Document;

    // Add a heading paragraph
    doc.BeginUpdate();
    Paragraph heading = doc.Paragraphs.Append();
    doc.InsertText(heading.Range.Start, "Getting Started with Word Processing API");
    doc.EndUpdate();

    // Apply heading style (bold, large font)
    CharacterProperties headingCp = doc.BeginUpdateCharacters(heading.Range);
    headingCp.Bold = true;
    headingCp.FontSize = 18;
    headingCp.ForeColor = Color.DarkBlue;
    doc.EndUpdateCharacters(headingCp);

    ParagraphProperties headingPp = doc.BeginUpdateParagraphs(heading.Range);
    headingPp.Alignment = ParagraphAlignment.Center;
    headingPp.SpacingAfter = Units.InchesToDocumentsF(0.2f);
    doc.EndUpdateParagraphs(headingPp);

    // Add a body paragraph
    Paragraph body = doc.Paragraphs.Append();
    doc.InsertText(body.Range.Start, "This document was created with DevExpress Word Processing Document API.");

    server.SaveDocument("QuickStart.docx", DocumentFormat.Docx);
}

What This Does

Creates a QuickStart.docx with a centered dark-blue bold heading and a body paragraph. The file is saved to the working directory and can be opened in any Word-compatible application.

Key Properties & API Surface

RichEditDocumentServer

| Property/Method | Type | Description | |----------------|------|-------------| | Document | Document | The document object — main access point for all content | | LoadDocument(path) | void | Load from file; format auto-detected or explicitly specified | | LoadDocument(stream, format) | void | Load from stream with explicit format | | LoadDocumentTemplate(path) | void | Load as template (prevents accidental overwrite) | | SaveDocument(path, format) | void | Save to file in the specified format | | ExportToPdf(path) | void | Export to PDF | | ExportToPdf(stream, options) | void | Export to PDF stream with PdfExportOptions | | Print() | void | Print with default printer | | Print(printerSettings) | void | Print with custom PrinterSettings | | Options | RichEditControlOptions | Access document capabilities, printing, annotations options | | BeforeImport | event | Customize import options per format | | BeforeExport | event | Customize export options per format | | CalculateDocumentVariable | event | Supply values for DOCVARIABLE fields |

Document (ISubDocument)

| Property/Method | Type | Description | |----------------|------|-------------| | Paragraphs | ParagraphCollection | All paragraphs in the document | | Sections | SectionCollection | Document sections (page layout) | | Tables | TableCollection | All tables | | Fields | FieldCollection | All fields | | Bookmarks | BookmarkCollection | All bookmarks | | Hyperlinks | HyperlinkCollection | All hyperlinks | | Shapes | ShapeCollection | Inline and floating shapes/images | | TrackChanges | DocumentTrackChangesOptions | Track changes settings | | Revisions | RevisionCollection | All tracked revisions | | AppendText(text) | DocumentPosition | Append text at end | | InsertText(pos, text) | DocumentPosition | Insert text at position | | BeginUpdateCharacters(range) | CharacterProperties | Start character format session | | EndUpdateCharacters(cp) | void | Commit character format session | | BeginUpdateParagraphs(range) | ParagraphProperties | Start paragraph format session | | EndUpdateParagraphs(pp) | void | Commit paragraph format session | | FindAll(text, options) | DocumentRange[] | Search text | | AppendDocumentContent(path) | DocumentRange | Append content from another file | | InsertDocumentContent(pos, path) | DocumentRange | Insert content at position | | SaveDocument(path, format) | void | Save document from Document instance |

Common Patterns

Load, Modify, Save

using (var server = new RichEditDocumentServer())
{
    server.LoadDocument("input.docx", DocumentFormat.Docx);
    Document doc = server.Document;

    // Modify first paragraph text color
    CharacterProperties cp = doc.BeginUpdateCharacters(doc.Paragraphs[0].Range);
    cp.ForeColor = Color.DarkRed;
    doc.EndUpdateCharacters(cp);

    server.SaveDocument("output.docx", DocumentFormat.Docx);
}

Search and Replace

DocumentRange[] found = doc.FindAll("OldText", SearchOptions.None);
foreach (DocumentRange range in found)
    doc.InsertText(range.Start, "NewText");
    // or: doc.Delete(range); doc.InsertText(range.Start, "NewText");

Mail Merge

using DevExpress.XtraRichEdit;
using DevExpress.XtraRichEdit.API.Native;

using (var server = new RichEditDocumentServer())
{
    server.LoadDocument("template.docx", DocumentFormat.Docx);

    // Assign data source (DataTable, DataSet, or object collection)
    server.Document.MailMergeDataSource = myDataTable;

    // Configure and execute
    MailMergeOptions options = server.CreateMailMergeOptions();
    options.MergeMode = MergeMode.NewSection;
    server.MailMerge(options, "output.docx", DocumentFormat.Docx);
}

> See [references/mail-merge.md](references/mail-merge.md) for master-detail reports, DataSet sources, image fields, and DOCVARIABLE fields.

Export to PDF

using DevExpress.XtraPrinting;

using (var server = new RichEditDocumentServer())
{
    server.LoadDocument("input.docx", DocumentFormat.Docx);
    PdfExportOptions options = new PdfExportOptions();
    options.DocumentOptions.Author = "My App";
    server.ExportToPdf("output.pdf", options);
}

Troubleshooting

| Symptom | Cause | Solution | |---------|-------|----------| | No usable version of ICU libraries on Linux | Missing ICU library for PDF export | Set env var DXEXPORT_ICU_VERSION_OVERRIDE=65.1 or install libicu | | Document saves with wrong format | DocumentFormat.Undefined passed to SaveDocument | Always specify an explicit DocumentFormat enum value | | Styles not available in new document | RichEditDocumentServer has no predefined styles | Create styles via ParagraphStyles.CreateNew() or load a template with styles | | Mail merge produces blank fields | Field names don't match data source column names | Verify MERGEFIELD names match column names exactly (case-sensitive) | | Compare throws exception on input documents | Input documents contain existing revisions | Accept or reject all revisions in both documents before calling Compare | | Version mismatch build error | Mixed DevExpress NuGet pac

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.