Word Processing Document API
- 5 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 are new to the Word Processing Document API, refer to the following topics first:
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.
- 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.
- 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.
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.
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 40-bit RC4 encryption 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: