A document editing API for DOCX files.

Read and change Word documents through an Office.js-compatible API. Run these operations in an open editor or against DOCX bytes on a server.

edit-contract.tsLIVE
1const matches = body.search('renewal term');
2matches.load('items'); await context.sync();
3matches.items[0].insertText('12 months', 'Replace');
4await context.sync();
Document changeParagraph 12
Before

The initial renewal term is unlimited.

AfterPending

The initial renewal term is unlimited.

Contract.docx

The initial renewal term is unlimited.

Operation queued

Connect your editor to a TypeScript backend.

Frontend
React or Vue
Backend
TypeScript / Node.js
Result
Edited DOCX
/ Capabilities

Use one document API in the browser and on the server.

DOCX editor API in the browser

Read Structured Document Tags (SDTs) by ID, tag, or title. Search text and queue document changes.

Server-side DOCX editing

Process document bytes in a Node route, worker, script, or background job.

Office.js-compatible automation

Attach the browser runtime to the document that your user already has open.

/ Implementation

How to edit DOCX files programmatically.

Use the Office.js-style load, write, and sync pattern in an open editor or a TypeScript backend.

  1. 01

    Choose the document runtime

    Attach the browser runtime to a React or Vue editor. Use the server runtime for Node routes, workers, and scripts.

  2. 02

    Find text and structured fields

    Search document text or address Structured Document Tags by ID, tag, or title. Load values before you read them.

  3. 03

    Apply a batch and save the DOCX

    Queue related writes, then call sync. The server runtime returns saved bytes. The browser host controls saving.

/ Industry applications

Examples by industry.

You define access, validation, retention, and approval rules. DOCX Editor applies supported document operations.

Legal

Contract lifecycle automation

Extract clauses, apply approved terms, and create reviewable contract changes from your workflow.

  • Replace defined terms
  • Insert approved clauses
  • Add comments and revisions
Healthcare

Forms and document generation

Fill templates and update structured fields while preserving the DOCX file your organization uses.

  • Fill patient-facing templates
  • Generate referral documents
  • Update headers, paragraphs, and fields
Insurance

Policy and claims documents

Move document work into your application instead of scripting desktop Word.

  • Generate notices from case data
  • Update policy schedules
  • Batch documents in server jobs
/ Questions

Common questions

How do I use the API in a React or Vue application?+

Use the browser runtime with the React or Vue editor. It reads and edits the document your user has open.

Can I use the API from a TypeScript backend?+

Yes. Pass DOCX bytes to the server runtime from a Node route, worker, script, or background job. It returns saved bytes.

Does the API require Microsoft Word?+

No. Browser and server operations run without Word, Office.js, or desktop UI automation.

Can existing Office.js code work with this API?+

The object model follows Office.js patterns. Check the compatibility guide for supported operations.

Can the DOCX editor API create tracked changes?+

Yes. Add Pro to write proposed insertions, replacements, and deletions as native tracked changes.

Add DOCX editing to your application.

Start with the open-source editor. Add commercial review and automation features when your workflow needs them.