$npx -y skills add DevExpress/agent-skills --skill devexpress-office-file-api-word-processingBuild .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
| 1 | # DevExpress Word Processing Document API |
| 2 | |
| 3 | 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. |
| 4 | |
| 5 | ## When to Use This Skill |
| 6 | |
| 7 | Use this skill when you need to: |
| 8 | |
| 9 | - Create Word documents (.docx, .rtf, .odt) programmatically without Microsoft Office |
| 10 | - Load and modify existing .docx / .doc / .rtf files in .NET |
| 11 | - Apply character and paragraph formatting, styles, or linked styles |
| 12 | - Build tables, lists, hyperlinks, and bookmarks in code |
| 13 | - Add headers, footers, footnotes, endnotes, or watermarks |
| 14 | - Perform mail merge — generate personalized letters, invoices, or reports from a data source |
| 15 | - Search and replace text, including regex-based search |
| 16 | - Export Word documents to PDF, HTML, or a series of page images |
| 17 | - Compare two documents and produce a revision-marked result |
| 18 | - Accept or reject tracked changes programmatically |
| 19 | - Merge or split Word documents |
| 20 | - Work with fields (MERGEFIELD, TOC, HYPERLINK, PAGE, DATE, IF, etc.) |
| 21 | - Protect documents with passwords or restrict editing permissions |
| 22 | |
| 23 | ## Prerequisites & Installation |
| 24 | |
| 25 | ### NuGet Packages |
| 26 | |
| 27 | | Package | Purpose | |
| 28 | |---------|---------| |
| 29 | | `DevExpress.Document.Processor` | Core Word processing (create, load, edit, save, mail merge) | |
| 30 | |
| 31 | ### .NET (8/9/10+) |
| 32 | |
| 33 | ```bash |
| 34 | dotnet add package DevExpress.Document.Processor |
| 35 | ``` |
| 36 | |
| 37 | ### .NET Framework (4.6.2+) |
| 38 | |
| 39 | ``` |
| 40 | Install-Package DevExpress.Document.Processor |
| 41 | ``` |
| 42 | |
| 43 | Alternatively, reference these assemblies from the DevExpress Unified Installer: |
| 44 | `DevExpress.Data`, `DevExpress.Drawing`, `DevExpress.Office.Core`, `DevExpress.RichEdit.Core`, `DevExpress.Printing.Core`, `DevExpress.Pdf.Core`. |
| 45 | |
| 46 | **Important**: All DevExpress packages in a project must share the same version number. A valid DevExpress license is required. |
| 47 | |
| 48 | ### Package Versions |
| 49 | |
| 50 | Unless the user explicitly requests a specific version, always target the latest DevExpress release (v26.1 at the time of writing). `dotnet add package <PackageName>` without `--version` installs the latest stable version — prefer this form. Never pin an older version in project files, Dockerfiles, or CI/CD pipelines unless the user asks for it. This is especially important in integration scenarios (Docker, cloud deployments). All `DevExpress.*` packages in a project must share the same version. |
| 51 | |
| 52 | ### Non-Windows Development (Linux, macOS, Docker, Cloud) |
| 53 | |
| 54 | The SkiaSharp-based drawing engine is enabled **automatically** on non-Windows platforms. Just add the `DevExpress.Drawing.Skia` package (plus `DevExpress.Pdf.SkiaRenderer` only if the app renders PDF page content): `dotnet add package DevExpress.Drawing.Skia`. |
| 55 | |
| 56 | If you still hit a `DllNotFoundException` for a Skia/HarfBuzz assembly, add the SkiaSharp native asset package matching your OS (e.g., `SkiaSharp.NativeAssets.Linux`, `SkiaSharp.NativeAssets.macOS`) — see [references/getting-started.md](references/getting-started.md) for the full setup and troubleshooting guide. |
| 57 | |
| 58 | ## Before You Start — Ask the Developer |
| 59 | |
| 60 | If the host agent has a structured question-asking tool available, use it to ask these questions one at a time with clear options — for example, Claude Code's `AskUserQuestion` tool or GitHub Copilot's `askQuestions` tool. If no such tool is available, ask the questions directly in the chat response before generating code. |
| 61 | |
| 62 | Before generating code, ask these questions to avoid rework: |
| 63 | |
| 64 | ### General Questions |
| 65 | 1. **Target framework**: Are you using .NET 8+ or .NET Framework 4.x? |
| 66 | 2. **New or existing project?**: Are you creating a new project or adding to an existing one? |
| 67 | 3. **Hosting model**: Console app, ASP.NET Core, Blazor, MAUI, WinForms, WPF, or something else? |
| 68 | |
| 69 | ### Word Processing–Specific Questions |
| 70 | 4. **Operation type**: Create new / read existing / modify / convert / mail merge? |
| 71 | 5. **Features needed**: Paragraphs & styles / tables / fields / |