Skip to main content

Format text

Apply bold, italic, underline, strikethrough, highlight, font, size or colour to occurrences of a text in the document, a paragraph range, a bookmark or a page; inputs left empty are not changed.

Command in the Word toolkit · id ooa.word/format_text · 17 inputs (1 required), 1 output

Inputs​

InputTypeRequiredDefaultWhat it is
TextStringYesText to format wherever it appears.
BoldBooleanNoBold on or off.
ItalicBooleanNoItalic on or off.
UnderlineBooleanNoSingle underline on or off.
SizeNumberNoFont size in points.
ColorStringNoHex text colour.
FontStringNoFont name, e.g. Calibri.
SessionStringNowordSession name.
Match caseBooleanNotrueMatch upper/lower case exactly.
Whole wordBooleanNofalseOnly match the text as a whole word, not inside a longer word.
OccurrenceStringNoallWhich occurrences to change, in document order: all, the first or the last.
HighlightStringNoHighlighter colour behind the text, or none to remove it.
StrikethroughBooleanNoStrikethrough on or off.
From paragraphNumberNo1-based first body paragraph to search; the whole document (with tables, headers and footers) when both are empty.
To paragraphNumberNo1-based last body paragraph to search, included; to the end when empty.
PageNumberNoOnly format text on this 1-based page of the body.
BookmarkStringNoOnly format text in the paragraphs a bookmark covers.

Outputs​

OutputTypeWhat it is
countNumberNumber of occurrences formatted.