Word Processing Document API
- 6 minutes to read
The Word Processing Document API is a non-visual .NET library that allows you to generate and process Microsoft® Word® documents across multiple platforms and operating systems. This library helps you automate such common tasks as file conversion, text formatting, document protection, mail merge, printing, and export to PDF/HTML.
The Word Processing Document API is available as part of the following DevExpress Subscriptions: Universal, DXperience, WinForms, WPF, Office File API, and ASP.NET. Refer to this page for details: DevExpress Subscription Plans.
If you own an active license for the DevExpress Office File API Subscription or DevExpress Universal Subscription, you can use the following additional features within your word processing app:
- Asynchronous load, save, and export (to PDF and HTML) operations
- Digital signatures
- Embedded charts
If you are new to the Word Processing Document API, refer to the following topics first:
Use NuGet Packages to Install the Word Processing Document API
Supported Document Elements
The Word Processing Document API allows you to create, access, modify, export, print, and remove the following document elements:
- Divide your document into sections and specify individual page settings for each section.
- Create new or remove existing paragraphs, and define paragraph formatting (alignment, line spacing, indentation, pagination options, background color, and so on).
- Create bulleted, numbered, or multilevel lists to arrange and outline information in your documents.
- Insert tables to organize your information in rows and columns. You can change the table layout (split or merge cells, insert or delete rows and columns) and customize the appearance of the entire table or individual cells.
- Shapes and Pictures
- The Word Processing Document API allows you to insert shapes and pictures. All shape types are supported: from simple lines and rectangles to 3D shapes with advanced effects.
- You can create charts to visualize data in your documents. The Word Processing Document API supports a broad range of 2D and 3D charts: from the commonly used Column and Line charts to modern Excel 2016 charts (Box and Whisker, Histogram, Pareto, Waterfall, Treemap, Sunburst, and Funnel).
- Hyperlinks and Bookmarks
- Insert hyperlinks to navigate to web pages and existing files. Create bookmarks and add links to them to jump to specific locations within your document.
- Headers and Footers
- Add headers and footers to your documents to repeat specific information (such as titles, authors, and page numbers) at the top and bottom of each page.
- Footnotes and Endnotes
- Use footnotes and endnotes to add supplemental notes, comments, and citations to text in your documents. Footnotes appear at the bottom of the page, and endnotes come at the end of the document or section.
- The Word Processing Document API allows you to insert picture and text watermarks, specify watermark options, and delete existing watermarks from a document.
- You can add checkbox form fields to your documents to create surveys and fillable forms. Checkboxes are interactive, so you can toggle their state as needed.
- OLE Objects
- The Word Processing Document API supports OLE (Object Linking and Embedding) technology that allows you to insert data (spreadsheets, images, presentations, charts, equations, and so on) from external applications into your document.
- ActiveX Controls
- The Word Processing Document API allows you to access existing ActiveX controls, obtain their properties (type, name, and ProgID), or remove these controls from a document.
Import, Export, and Print Documents
You can create, load, convert, merge, split, edit, print, and save documents in code. The Word Processing Document API supports left-to-right and right-to-left document layouts.
- Supported Formats
- Import and Export
- HTML Import and Export
- Merge and Split Documents
- Print Documents
Mail Merge and Dynamic Content
Use Mail Merge to automate document generation. Create a template with value placeholders and bind this template to an external data source to generate multiple documents. The Word Processing Document API has a set of events that allow you to control the Mail Merge process at every stage.
You can use fields to insert dynamic content (such as RSS feed, text, images, or barcodes) into a document. Fields are automatically updated when the document is saved, printed, or when a mail merge operation is executed.
The Word Processing Document API ships with the following format features:
Format document text. Change individual format attributes (font settings, character style, background and foreground colors) for any text fragment. You can also create character and paragraph styles to specify multiple format attributes simultaneously and apply the same formatting to different parts of your text.
Change the page layout. Configure settings like page orientation, paper size, and margins, divide a page into columns, and insert page breaks. You can apply separate layout settings to the first page, and hide its header and footer to start numbering from the second page.
Insert a table of contents. Mark specific parts of your document as table entries and use the TOC field to build the table of contents.
Enable word hyphenation. Embed different dictionaries to automatically hyphenate text.
Protect and Secure Documents
The Word Processing Document API allows you to protect your documents to prevent unauthorized access. Security options include:
- Protect your document with a password. Make a document read-only or allow users to make revisions, add comments, or fill in forms without making other modifications.
- Grant user permissions. Allow authorized users to edit specific parts of a protected document.
- Open and save password-encrypted documents. The Word Processing Document API uses 256-bit AES encryption for DOCX files and the custom RC4 CryptoAPI implementation for DOC files.
- Sign Microsoft Word documents. Add digital signatures to your documents, configure signature options, and validate existing signatures to ensure the authenticity and integrity of document content.
The Word Processing Document API offers the following collaboration options:
- Enable Track Changes. View, accept, or reject revisions made to a document. Specify a color and format for each revision type and change the review mode.
- Use comments. Attach comments to specific parts of a document, highlight commented ranges, and modify or delete existing comments.
DevExpress Rich Text Editors
If you need to implement a Word-inspired user interface for your document processing application (web or desktop), you can use the following DevExpress Rich Text Editor controls: