Skip to main content

Find and replace text

Find text everywhere (body, tables, headers, footers) or in a paragraph range, bookmark or page and count it, or replace it, e.g. fill {{customer}} placeholders; can ignore case, match whole words or take only the first or last occurrence.

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

Inputs​

InputTypeRequiredDefaultWhat it is
FindStringYesText to find.
Replace withStringNoReplacement text; empty removes what is found.
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.
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 look on this 1-based page of the body (from Word's saved page layout, else the stored page breaks).
ReplaceBooleanNotrueReplace what is found with the replacement text (empty removes it); when off the step only counts the matches and changes nothing (the default for new steps).
BookmarkStringNoOnly look in the paragraphs a bookmark covers.

Outputs​

OutputTypeWhat it is
countNumberNumber of matches found, or of replacements made.