API member directory

Find every public editing API class, member group, enum, support type, and host extension.

Use this directory to find task examples and runtime limits for the public API. The generated API reference provides exact declarations, overloads, and enum values. The repository also publishes generated declarations for the root entry, the browser entry, and the agent entry.

A declaration or enum value does not guarantee runtime support for every document or argument. Read the linked guide before choosing an operation. Members marked @internal, including factories and hydration helpers, are not supported application APIs. Obtain model objects from context.document; do not construct them.

Runtime and common members

Public symbolMembers or valuesGuide
DocxEditor, DocxEditorNamespacecreateServer, createCollaborative; browser entry adds createBrowserRuntime and setup
DocxEditorRuntime, DocxEditorServerRuntimecapabilities, the three run overloads (callback, objects and callback, options and callback), preview (browser runtime only), dispose; server adds saveRuntime and setup
DocumentPreview, DocumentPreviewStatus, PreviewCallback, CommitPreviewOptionsstatus (active, stale, ended), result, commit with optional rebase, discard, reveal, onStatusChangedPreview other wording before you write it
RunOptions, HistoryGroup, HistoryGroupOutcomehistoryGroup (browser runtime only), previousObjects; the editor history group handle's state, lastOutcome, and endJoin an editor history group
CreateServerOptions, CreateCollaborativeOptions, CreateBrowserOptionsAuthor, revision view, host-specific parsing, modules, and paginationRuntime and setup
DocumentCapabilitiesdocument, save, events, selection, scrolling, layout, previewRuntime and setup
DocumentLimits, DocumentZipLimits, DocumentXmlLimits, EditorModule, RuntimeDiagnosticInput budgets, DOM-free module contributions, and the anonymous diagnostics a module with onDiagnostic receivesRuntime and setup
ServerPaginationOptionsmeasurer, optional producerFields and pagination
RequestContext, RunCallbackdocument, capabilities, trackedObjects, sync and async callback resultBatching, loading, and errors
ClientObjectInherited context, isNullObject, and loadBatching, loading, and errors
ClientResultvalue, isLoaded; returned by RevisionCollection.resolve() and setAuthor()Batching, loading, and errors
TrackedObjectsadd, remove, each accepting one object or an arrayBatching, loading, and errors
LoadOption, LoadQueryOptionsExplicit property names and items/<property> paths on collections; select, top, skip; reserved expandBatching, loading, and errors
DocxEditorError, DocxEditorErrorInit, DocxEditorErrorCode, DocxEditorDebugInfo, DocxEditorInnerError, isDocxEditorErrorStable error codes, target, resource limit, revision metadata, and debugInfo with the engine reason as innerErrorBatching, loading, and errors

Agent helpers

The @docx-editor.dev/editor-api/agent entry holds helpers next to the object model. They are not Office.js members. They use only the Office.js-shaped calls of the object model on the context and paragraph that you pass in.

Public symbolMembers or valuesGuide
prepareRewriteRead a paragraph for your model; PrepareRewriteOptions takes keepPlaceholdersPropose an AI rewrite as tracked changes
RewriteDraft, RewriteResult, RewritePlaceholder, RewritePlaceholderKindPlain data: paragraphId, original, text, placeholders, and legend on a draft, with check() and apply() for the model text; original, proposed, changes, and paragraphId on a resultPropose an AI rewrite as tracked changes
RewriteError, RewriteErrorCodecode, isModelError, cause, suppressedHandle errors

Document and text objects

Every model object inherits the common ClientObject members. Each collection also exposes loaded, read-only items.

ObjectPublic members beyond inherited membersGuide
DocumentremoveDocumentInformation, properties, body, paragraphs, sections, contentControls, comments, revisions, footnotes, endnotes, changeTrackingMode, deleteBookmark, getBookmarkRange, getBookmarkRangeOrNullObjectText and ranges, Page layout and stories, Tracked changes, Search and navigation
RemoveDocInfoTypeAll standard enum values; only documentProperties removal is supportedRemove document properties
DocumentPropertiesauthor, title, subject, keywords, comments, category, read-only lastAuthorDocument properties
Bodytext, footnotes, endnotes, paragraphs, getRange, search, clear, insertText, insertParagraph; font, style, lists, bookmarks, contentControls, getComments, revisions, tables, inlinePictures, shapes, fieldsText and ranges, Page layout and stories
Paragraphtext, uniqueLocalId, getRange, getTextRanges, getReviewedText, contentControls, search, insertText, insertParagraph, split, clear, delete; font, style, paragraph formatting; list, listItem, startNewList, attachToList, detachFromList; shapesText and ranges, Formatting and styles, Lists and numbering
Rangetext, paragraphs, getRange, getTextRanges, expandTo, getReviewedText, contentControls, search, insertText, insertParagraph, clear, delete, select; font, style, hyperlink, bookmarks, getBookmarks, revisions, tables, inlinePictures, fields; insertTable, insertInlinePictureFromBase64, insertField, insertOoxml (one equation), insertBreak, insertContentControl, insertComment, insertBookmarkText and ranges and the dedicated insertion guides
ParagraphCollectiongetFirst, getLast, getFirstOrNullObject, getLastOrNullObjectSearch and navigation
RangeCollectiongetFirst, getLast, getFirstOrNullObjectSearch and navigation
Bookmark, BookmarkCollectionBookmark name, range, select, delete; collection itemsSearch and navigation
SearchOptions, SelectionModePlain-text search flags and browser selection locationsSearch and navigation
InsertLocation, BesideLocation, BodyInsertParagraphLocation, BodyInsertTextLocation, ParagraphInsertTextLocation, RangeInsertTextLocationInsertion location enums and aliasesText and ranges
RangeLocationgetRange location valuesText and ranges

Formatting, lists, tables, and pictures

Font writes honor inherited complex-script properties. Font reads return authored values or null; they do not resolve inherited formatting.

Object or typePublic members beyond inherited membersGuide
Fontbold, italic, color, name, size, underline, strikeThrough, highlightColor, subscript, superscriptFormatting and styles
Paragraph formattingalignment, firstLineIndent, leftIndent, rightIndent, lineSpacing, spaceBefore, spaceAfter, readingOrder (DocxEditor addition)Formatting and styles, including right-to-left paragraphs
UnderlineType, Alignment, ParagraphAlignment, ParagraphReadingOrderFont underline, paragraph alignment, and paragraph direction valuesFormatting and styles
Listid, paragraphs, getLevelParagraphs, insertParagraph, setLevelBullet, setLevelNumbering, setLevelStartingNumber, setLevelIndentsLists and numbering
ListCollection, ListItemCollection getFirst, getById; item levelLists and numbering
ListBullet, ListNumberingBullet and number marker valuesLists and numbering
Tablevalues, style, headerRowCount, rowCount, columnCount, rows, getCell, addRows, addColumns, deleteRows, deleteColumns, mergeCells, deleteTables and cells
TableRow, TableCellRow cells, insertRows; cell body, value, columnWidth, shadingColor, verticalAlignment, splitTables and cells
TableCollection, TableRowCollection, TableCellCollectiongetFirst, getFirstOrNullObjectTables and cells
VerticalAlignmentCell alignment valuesTables and cells
InlinePicturewidth, height, lockAspectRatio, altTextDescription, deleteInline pictures
InlinePictureCollectiongetFirst, getLast, getFirstOrNullObject, getLastOrNullObjectInline pictures
Shape, ShapeCollection, ShapeTypeShape id, name, type, body; collection getFirst, getFirstOrNullObject, getByTypes; shape type valuesPage layout and stories

Fields, stories, and controls

Range.insertContentControl() creates RichText, PlainText, and DatePicker controls.

Range.insertBreak() supports Line, Page, and SectionNext. Only Line supports tracked insertion and text edits in the same sync. Text reads use \v for manual line breaks and U+000E for column breaks. For migration instructions, see Upgrade text processing.

Object or typePublic members beyond inherited membersGuide
Field, FieldCollectionField code, result (a Range that reads text and takes insertText(text, 'Replace')), updateResult, delete; collection getFirst, getLast, getFirstOrNullObject, getLastOrNullObjectFields and pagination
FieldType, FieldTypeLiteralOffice.js-compatible field vocabulary; authoring supports Page, NumPages, Ref, PageRef, NoteRef, Seq, StyleRef, Date, Time, and the documented inert TOC subset, untracked or as tracked insertionsFields and pagination
Section, SectionCollectionSection body, pageSetup, getHeader, getFooter, getNext; collection getFirstPage layout and stories
PageSetuppageWidth, pageHeight, orientation, topMargin, bottomMargin, leftMargin, rightMarginPage layout and stories
HeaderFooterType, PageOrientation, BreakTypeStory variants, orientation, and break vocabularyPage layout and stories
NoteItem, NoteItemCollection, NoteItemTypeNote type, text, body, delete, getNext; collection getFirst; note kind valuesPage layout and stories
ContentControlid, tag, title, subtype, isBound, cannotDelete, cannotEdit, placeholderShown, temporary, text, paragraphs, contentControls, getRange, setValue, insertText, deleteContent controls
ContentControlCollectiongetFirst, getFirstOrNullObject, getById, getByTag, getByTitleContent controls
ContentControlType, ContentControlSubtype, ContentControlValue, ContentControlLockStateCreation vocabulary, DOCX subtype terms, typed values, and lock vocabularyContent controls

Comments and revisions

Comment.delete() and CommentReply.delete() use scan budgets that scale with the loaded document. Deletions in one batch share marker scans and rebuild each affected part once. See Delete threads or replies for deletion guarantees and limits.

Document.changeTrackingMode = 'TrackMineOnly' tracks supported text, font, paragraph, list, table, and content control edits. Column changes require an eligible complete proposed table. Page setup refuses while tracking. For supported operations and collaboration limits, see Tracked changes.

Object or typePublic members beyond inherited membersGuide
CommentauthorName, creationDate, id, text, delete, resolved, replies, getRange, replyComments
CommentReplyauthorName, creationDate, id, text, deleteComments
CommentCollection, CommentReplyCollectiongetFirstComments
Revisionauthor, date, type, range, accept, rejectTracked changes
RevisionCollectionresolve, setAuthor, acceptAll, rejectAllTracked changes
getReviewItemRevisions, getReviewItemRange, getReviewItemRangeOrNullObjectDocxEditor functions that return the changes a review item key names, or the range it coversWork with review items
ChangeTrackingMode, ChangeTrackingVersion, RevisionTextView, RevisionTypeRuntime tracking modes, getReviewedText versions, read views, and published revision typesTracked changes

Distinguish host extensions from Office.js compatibility

Host factories, runtime capabilities, previews, input budgets, and collaboration setup are DocxEditor infrastructure. They do not represent Microsoft Office add-in APIs. Review item ranges, body-scoped bookmarks and revisions, document notes, typed control values, and nullable review dates include documented differences.

External document refresh

The refresh controller belongs to the browser host, outside the Office.js document model. RefreshHighlightOptions controls change selection and decoration. NavigateToChangeOptions controls scroll alignment, motion, padding, and focus. For more information, see Document refresh API.

RefreshChangeInput.description supplies a processor review summary. RefreshChange.diagnostic reports unavailable locations with stable codes and the requested anchor. Refresh resets selection and undo history. It refuses collaborative sessions.

Document properties

Document.properties returns a DocumentProperties proxy. It exposes the string properties author, title, subject, keywords, comments, and category. Load each property before reading it. Assignments commit at context.sync(). Missing properties read as empty strings. An empty assignment clears that value.

Writes preserve unrelated document properties. Values must contain XML-safe text with at most 4096 UTF-16 code units. TrackMineOnly refuses these writes with NotSupported. Individual dates and custom properties are unsupported. lastAuthor reads cp:lastModifiedBy and has no setter.

await runtime.run(async (context) => {
  const properties = context.document.properties;
  properties.author = 'Public Records Office';
  properties.title = 'Release packet';
  properties.subject = 'Public information';
  properties.keywords = '';
  properties.comments = '';
  await context.sync();
});

Collaborative writes require an existing core-properties part. If the input omits this part, set properties before joining collaboration. Concurrent creation of this package part cannot merge safely.

Remove document properties

Call document.removeDocumentInformation('DocumentProperties') to remove standard core, extended, and custom property parts. Keep this command as the only write in its sync. This also removes last-author information and property relationships. It preserves document content, comments, revisions, and media.

Ambiguous parts, incorrect roots or types, and unknown dependencies refuse with NotSupported. The method refuses all other RemoveDocInfoType modes, tracked writes, and collaboration. This subset does not anonymize text, cached field results, images, or review authors.

await runtime.run(async (context) => {
  context.document.removeDocumentInformation('DocumentProperties');
  await context.sync();
});

Next steps

See Office.js compatibility before migrating Office.js code. The generated reference remains the declaration authority; runtime notes and tests establish supported behavior.

For integration patterns, see Connect an agent to a document.