Class NotesPage

NotesPage

A notes page in a presentation.

These pages contain the content for presentation handouts, including a a shape that contains the slide's speaker notes. Each slide has one corresponding notes page. Only the text in the speaker notes shape can be modified.

Methods

MethodReturn typeBrief description
getGroups()Group[]Returns the list of Group objects on the page.
getImages()Image[]Returns the list of Image objects on the page.
getLines()Line[]Returns the list of Line objects on the page.
getObjectId()StringGets the unique ID for the page.
getPageElements()PageElement[]Returns the list of PageElement objects rendered on the page.
getPlaceholder(placeholderType)PageElementReturns the placeholder PageElement object for a specified PlaceholderType or null if a matching placeholder is not present.
getPlaceholder(placeholderType, placeholderIndex)PageElementReturns the placeholder PageElement object for a specified PlaceholderType and a placeholder index, or null if the placeholder is not present.
getPlaceholders()PageElement[]Returns the list of placeholder PageElement objects in the page.
getShapes()Shape[]Returns the list of Shape objects on the page.
getSheetsCharts()SheetsChart[]Returns the list of SheetsChart objects on the page.
getSpeakerNotesShape()ShapeGets the shape containing the speaker notes on the page.
getTables()Table[]Returns the list of Table objects on the page.
getVideos()Video[]Returns the list of Video objects on the page.
getWordArts()WordArt[]Returns the list of WordArt objects on the page.
replaceAllText(findText, replaceText)IntegerReplaces all instances of text matching find text with replace text.
replaceAllText(findText, replaceText, matchCase)IntegerReplaces all instances of text matching find text with replace text.

Detailed documentation

getGroups()

Returns the list of Group objects on the page.

Return

Group[]


getImages()

Returns the list of Image objects on the page.

Return

Image[]


getLines()

Returns the list of Line objects on the page.

Return

Line[]


getObjectId()

Gets the unique ID for the page. Object IDs used by pages and page elements share the same namespace.

Return

String


getPageElements()

Returns the list of PageElement objects rendered on the page.

Return

PageElement[]


getPlaceholder(placeholderType)

Returns the placeholder PageElement object for a specified PlaceholderType or null if a matching placeholder is not present.

If there are multiple placeholders with the same type, it returns the one with minimal placeholder index. If there are multiple matching placeholders with the same index, it returns the first placeholder from the page's page elements collection.

 var slide = SlidesApp.getActivePresentation().getSlides()[0];
 var placeholder = slide.getPlaceholder(SlidesApp.PlaceholderType.CENTERED_TITLE);
 

Parameters

NameTypeDescription
placeholderTypePlaceholderType

Return

PageElement


getPlaceholder(placeholderType, placeholderIndex)

Returns the placeholder PageElement object for a specified PlaceholderType and a placeholder index, or null if the placeholder is not present.

If there are multiple placeholders with the same type and index, it returns the first placeholder from the page's page elements collection.

 var slide = SlidesApp.getActivePresentation().getSlides()[0];
 var placeholder = slide.getPlaceholder(SlidesApp.PlaceholderType.CENTERED_TITLE, 0);
 

Parameters

NameTypeDescription
placeholderTypePlaceholderType
placeholderIndexInteger

Return

PageElement


getPlaceholders()

Returns the list of placeholder PageElement objects in the page.

 var master = SlidesApp.getActivePresentation().getMasters()[0];
 Logger.log('Number of placeholders in the master: ' + master.getPlaceholders().length);
 

Return

PageElement[]


getShapes()

Returns the list of Shape objects on the page.

Return

Shape[]


getSheetsCharts()

Returns the list of SheetsChart objects on the page.

Return

SheetsChart[]


getSpeakerNotesShape()

Gets the shape containing the speaker notes on the page.

Return

Shape


getTables()

Returns the list of Table objects on the page.

Return

Table[]


getVideos()

Returns the list of Video objects on the page.

Return

Video[]


getWordArts()

Returns the list of WordArt objects on the page.

Return

WordArt[]


replaceAllText(findText, replaceText)

Replaces all instances of text matching find text with replace text. The search is case insensitive.

Parameters

NameTypeDescription
findTextStringThe text to find.
replaceTextStringThe text to replace the matched text.

Return

Integer — the number of occurrences changed


replaceAllText(findText, replaceText, matchCase)

Replaces all instances of text matching find text with replace text.

Parameters

NameTypeDescription
findTextStringThe text to find.
replaceTextStringThe text to replace the matched text.
matchCaseBooleanIf true, the search is case sensitive; if false, the search is case insensitive.

Return

Integer — the number of occurrences changed

发送以下问题的反馈:

此网页
Apps Script
Apps Script