Skip to main content
Functions over EditorModel that a menu or ribbon calls: clipboard, links, bookmarks, notes, headers and footers, files and passwords. Guide: Build your own skin.

runClipboard()

Cut, Copy or Paste as a menu button does it: the browser’s clipboard, with a hint when it is blocked. Import from @reductoai/docx-editor, @reductoai/docx-editor/model.

PasteMode

Word’s paste options: keep the source formatting (colour, size, face, headings, alignment and lists), merge into the destination’s (bold, italic, underline and strike survive), or text only. Import from @reductoai/docx-editor, @reductoai/docx-editor/model.

openLinkDialog()

Word’s Ctrl+K: edit the link under the caret, or make one over the selection. Import from @reductoai/docx-editor, @reductoai/docx-editor/model.

selectTablePart()

Word’s Table Layout > Select: the caret’s cell, row, column or table as a cell selection. Import from @reductoai/docx-editor, @reductoai/docx-editor/model.

TablePart

Import from @reductoai/docx-editor, @reductoai/docx-editor/model.

addBookmark()

Add over the selection, out of any header or note; a name in use moves here. Import from @reductoai/docx-editor, @reductoai/docx-editor/model.

bookmarksOf()

Body bookmarks; Word’s dialog lists hidden ones only when asked, sorted by name or by location. Import from @reductoai/docx-editor, @reductoai/docx-editor/model.

deleteBookmark()

Import from @reductoai/docx-editor, @reductoai/docx-editor/model.

goToBookmark()

Select what a bookmark spans, as Word’s Go To does; false when no bookmark has the name. Import from @reductoai/docx-editor, @reductoai/docx-editor/model.

showNotes()

From a note, back to its mark; from the body, into the first note at or after the caret. Import from @reductoai/docx-editor, @reductoai/docx-editor/model.

stepNote()

The next (+1) or previous (-1) note mark of a kind from the caret; false when there is none. Import from @reductoai/docx-editor, @reductoai/docx-editor/model.

headerFooterInView()

“First Page Header -Section 2-”, as Word labels the band; undefined outside a header or footer. Import from @reductoai/docx-editor, @reductoai/docx-editor/model.

HeaderFooterInView

The header or footer being edited, with the label Word shows on its band. Import from @reductoai/docx-editor, @reductoai/docx-editor/model.

stepHeaderFooter()

Word’s Previous / Next: the nearest page in that direction that shows another one of this kind. Import from @reductoai/docx-editor, @reductoai/docx-editor/model.

linkToPrevious()

Word’s Link to Previous for the header or footer being edited; the caret stays on its page. Import from @reductoai/docx-editor, @reductoai/docx-editor/model.

removeHeaderFooter()

Word’s Remove Header / Remove Footer: the one the caret’s page shows is emptied to a single paragraph; the other first-page, even and odd ones stay. False when that page shows none. Import from @reductoai/docx-editor, @reductoai/docx-editor/model.

insertTextFromFile()

Insert > Object > Text from File: a whole .docx lands at the caret as one paste, styles and pictures with it. Import from @reductoai/docx-editor, @reductoai/docx-editor/model.

imageFileFrom()

Import from @reductoai/docx-editor, @reductoai/docx-editor/model.

caretPageOf()

The 0-based page the selection’s focus sits on. Import from @reductoai/docx-editor, @reductoai/docx-editor/model.

editorPaletteCommands()

Every palette row the editor can service right now: the context-menu leaves (clipboard, links, breaks, review threads, picture wrap) plus the full formatting tree. Menu branches the tree already covers are skipped. Import from @reductoai/docx-editor, @reductoai/docx-editor/model.

peerColor()

One colour per name, the same in every tab. Import from @reductoai/docx-editor, @reductoai/docx-editor/model.

isEncryptedDocx()

True when the bytes are an Office password-to-open container, not a zip. Import from @reductoai/docx-editor, @reductoai/docx-editor/model, @reductoai/docx/browser.

decryptDocx()

The .docx bytes of a password-to-open file; throws DocxPasswordError on a wrong password. Import from @reductoai/docx-editor, @reductoai/docx-editor/model, @reductoai/docx/browser.

encryptDocx()

The .docx bytes inside Word’s password-to-open container, as Word 2010+ writes it. Import from @reductoai/docx-editor, @reductoai/docx-editor/model, @reductoai/docx/browser.

modifyPasswordMatches()

True when password is the password to modify; a hash Word 16 would not write never matches. Import from @reductoai/docx-editor, @reductoai/docx-editor/model.

DocxPasswordError

A password that does not open the file, or a file that is not an encrypted package. Import from @reductoai/docx-editor, @reductoai/docx-editor/model, @reductoai/docx/browser.

DocxPasswordError properties

DocxPasswordError.captureStackTrace()

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.
The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}. The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace. The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

DocxPasswordError.prepareStackTrace()

See https://v8.dev/docs/stack-trace-api#customizing-stack-traces

DOCX_MIME

Import from @reductoai/docx-editor, @reductoai/docx-editor/model.

PDF_MIME

Import from @reductoai/docx-editor, @reductoai/docx-editor/model.