# Paragraph Formatting operations

> Paragraph-level direct formatting: alignment, indentation, spacing, borders, shading, and more.



21 operations. Names, descriptions, and behavior flags come from the canonical contract.

## Operations

- [`format.paragraph.resetDirectFormatting`](/document-api/reference/format/paragraph/reset-direct-formatting) (mutates, tracked): Strip all direct paragraph formatting while preserving style reference, numbering, and section metadata.
- [`format.paragraph.setAlignment`](/document-api/reference/format/paragraph/set-alignment) (mutates, tracked): Set visual paragraph alignment on a paragraph-like block. For RTL paragraphs, left/right are translated to Word-compatible stored justification values.
- [`format.paragraph.clearAlignment`](/document-api/reference/format/paragraph/clear-alignment) (mutates, tracked): Remove direct paragraph alignment, reverting to style-defined or default alignment.
- [`format.paragraph.setIndentation`](/document-api/reference/format/paragraph/set-indentation) (mutates, tracked): Set paragraph indentation properties (signed left/right, firstLine, hanging) in twips.
- [`format.paragraph.clearIndentation`](/document-api/reference/format/paragraph/clear-indentation) (mutates, tracked): Remove all direct paragraph indentation.
- [`format.paragraph.setSpacing`](/document-api/reference/format/paragraph/set-spacing) (mutates, tracked): Set paragraph spacing properties (before, after, line, lineRule) in twips.
- [`format.paragraph.clearSpacing`](/document-api/reference/format/paragraph/clear-spacing) (mutates, tracked): Remove all direct paragraph spacing.
- [`format.paragraph.setKeepOptions`](/document-api/reference/format/paragraph/set-keep-options) (mutates, tracked): Set keep-with-next, keep-lines-together, and widow/orphan control flags.
- [`format.paragraph.setOutlineLevel`](/document-api/reference/format/paragraph/set-outline-level) (mutates, tracked): Set the paragraph outline level (0–9) or null to clear.
- [`format.paragraph.setFlowOptions`](/document-api/reference/format/paragraph/set-flow-options) (mutates, tracked): Set paragraph flow flags: contextual spacing, page-break-before, suppress-auto-hyphens, and the advanced layout toggles auto-space-DE, auto-space-DN, adjust-right-indent, and snap-to-grid.
- [`format.paragraph.setTabStop`](/document-api/reference/format/paragraph/set-tab-stop) (mutates, tracked): Add or replace a tab stop at a given position.
- [`format.paragraph.clearTabStop`](/document-api/reference/format/paragraph/clear-tab-stop) (mutates, tracked): Remove a tab stop at a given position.
- [`format.paragraph.clearAllTabStops`](/document-api/reference/format/paragraph/clear-all-tab-stops) (mutates, tracked): Remove all tab stops from a paragraph.
- [`format.paragraph.setBorder`](/document-api/reference/format/paragraph/set-border) (mutates, tracked): Set border properties for a specific side of a paragraph.
- [`format.paragraph.clearBorder`](/document-api/reference/format/paragraph/clear-border) (mutates, tracked): Remove border for a specific side or all sides of a paragraph.
- [`format.paragraph.setShading`](/document-api/reference/format/paragraph/set-shading) (mutates, tracked): Set paragraph shading (background fill, pattern color, pattern type).
- [`format.paragraph.clearShading`](/document-api/reference/format/paragraph/clear-shading) (mutates, tracked): Remove all paragraph shading.
- [`format.paragraph.setMarkRunProps`](/document-api/reference/format/paragraph/set-mark-run-props) (mutates): Set the paragraph mark's run properties (w:pPr/w:rPr), e.g. the font size or specVanish carried by the paragraph-end mark. Available on v2-backed sessions only; v1-backed sessions currently return `CAPABILITY_UNAVAILABLE`.
- [`format.paragraph.setDirection`](/document-api/reference/format/paragraph/set-direction) (mutates, tracked): Set paragraph base direction (LTR or RTL via w:bidi). Optionally align text to match.
- [`format.paragraph.clearDirection`](/document-api/reference/format/paragraph/clear-direction) (mutates, tracked): Remove explicit paragraph direction, reverting to inherited or default (LTR).
- [`format.paragraph.setNumbering`](/document-api/reference/format/paragraph/set-numbering) (mutates): Attach numbering (numId + level) to an existing paragraph or heading so it joins a numbered sequence. Numbering is a paragraph property; the node and its style are otherwise unchanged, though any direct paragraph indent is cleared so the numbering level controls indentation. Direct edits only; tracked mode is unsupported.

