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 |
|---|---|---|
|
| The slide to work on. |
|
| The text to look for. |
|
| The text to put in its place. |
|
| Whether the search is case-sensitive. |
Returns
number — how many occurrences were replaced.
Throws
Exception | Condition |
|---|---|
| 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
23 September 2026
This documentation was generated with AI (Claude) from the library's source code.