Skip to main content
Version: Current

Find and Replace

Description​

The Find and Replace activity searches for text within a Microsoft Word document and replaces matching occurrences with the specified replacement text.

The activity updates the specified Word File in place. The same file reference can be used by subsequent Word activities.


Common settings​

Use Process Data to bind supported inputs to workflow values or upstream outputs. See Common Activity Features for shared execution, error-handling, and output-persistence settings. Availability depends on the activity.

Design-Time Configuration​

Display Text​

The label displayed for this activity on the workflow canvas.

Word File​

The Word document to modify.

See Word Document Selection.

Password​

Optional password used to open a password-protected document.

Text To Find​

The text to search for within the document.

Text To Replace​

The text that replaces each matching occurrence.

Occurrence​

Specifies which matching occurrences are replaced.

Available options:

  • First
  • Last
  • All

Default: All


Text Search Options​

Page Lookup Mode​

Specifies whether the search is limited to particular pages.

Available options:

  • All
  • Single
  • Range

Default: All

Lookup Page By​

Available when Page Lookup Mode is Single.

Specifies how the page is identified.

Available options:

  • Page Number
  • Page Index

Page Number​

The printed page number to search.

Available when:

  • Page Lookup Mode = Single
  • Lookup Page By = Page Number

Page Index​

The zero-based page index to search.

Available when:

  • Page Lookup Mode = Single
  • Lookup Page By = Page Index

From Page Index​

The starting zero-based page index.

Available when Page Lookup Mode is Range.

To Page Index​

The ending zero-based page index.

Available when Page Lookup Mode is Range.


Search In​

Body​

Search within the document body.

Default: True

Search within document headers.

Default: False

Search within document footers.

Default: False

If Body, Header, and Footer are all disabled, the document body is searched automatically.


Search Options​

Match Case​

Determines whether the search is case-sensitive.

Default: False

Match Whole Words Only​

Matches complete words only.

Default: False

Use Regular Expression​

Treats the search pattern as a regular expression.

Default: False

Regular Expression​

The regular expression pattern used to identify matches.

Available when Use Regular Expression is enabled.


Cross-Platform Considerations​

warning

Page-based search and replacement can produce different results on Windows and Linux because page layout calculations depend on the Word rendering engine.

For the most consistent behavior across platforms, avoid page-restricted searches when possible and use content-based matching instead.


Outputs​

Result​

Summary information describing the replacements performed within the document.

See ReplacementResult.

Example: Replace a placeholder​

Set Text To Find to [CustomerName], Text To Replace to the customer name from Process Data, and Occurrence to All. Leave regular-expression matching off for this literal placeholder. Search the body and any headers/footers that contain the placeholder.

After execution, inspect Result → BodyReplacements, ReplacedInHeader, and ReplacedInFooter to check where replacements occurred. The same Word File reference contains the updated document.