apps-script-utils 2.1.1 Help

findReplaceAllTextInSlide

function findReplaceAllTextInSlide( slide: GoogleAppsScript.Slides.Slide, findText: string, replaceText: string, matchCase: boolean = true ): number;

Slides offers find-and-replace across a whole presentation; this narrows it to a single slide, which is what filling one templated page at a time needs. Matching is case-sensitive unless told otherwise.

Parameters

Parameter

Type

Description

slide

GoogleAppsScript.Slides.Slide

The slide to work on.

findText

string

The text to look for.

replaceText

string

The text to put in its place.

matchCase (optional) = true

boolean

Whether the search is case-sensitive. true by default.

Returns

number — how many occurrences were replaced.

Throws

Exception

Condition

SlideNotFoundException

the first argument is not a slide.

Examples

In use

const slide = SlidesApp.getActivePresentation().getSlides()[0]; const replaced = findReplaceAllTextInSlide(slide, "{{ client }}", "Acme", false);

See also

Source

src/appsscript/slide/findReplaceAllTextInSlide.ts

23 September 2026

This documentation was generated with AI (Claude) from the library's source code.