Stay organized with collections Save and categorize content based on your preferences.
SlidesAppCreates and opens Presentations
that can be edited.
// Open a presentation by ID. let preso = SlidesApp.openById('PRESENTATION_ID_GOES_HERE'); // Create and open a presentation. preso = SlidesApp.create('Presentation Name');Properties Property Type Description
AlignmentPosition
AlignmentPosition
An enumeration of the types of alignment positions. ArrowStyle
ArrowStyle
An enumeration of the different arrow styles that a Line
can have. AutoTextType
AutoTextType
An enumeration of the types of auto text. AutofitType
AutofitType
An enumeration of autofit types. CellMergeState
CellMergeState
An enumeration of the different merge states of a table cell. ColorType
ColorType
An enumeration of color types. ContentAlignment
ContentAlignment
An enumeration of values used to specify content alignment. DashStyle
DashStyle
An enumeration of the different dash styles that a Line
can have. FillType
FillType
An enumeration of fill types. LineCategory
LineCategory
An enumeration of the categories of Line
. LineFillType
LineFillType
An enumeration of the types of LineFill
. LineType
LineType
An enumeration of the types of Line
. LinkType
LinkType
An enumeration of the types of links. ListPreset
ListPreset
An enumeration of the types of list presets. PageBackgroundType
PageBackgroundType
An enumeration of the types of page backgrounds. PageElementType
PageElementType
An enumeration of the types of page elements. PageType
PageType
An enumeration of the types of pages. ParagraphAlignment
ParagraphAlignment
An enumeration of the types of paragraph alignment. PlaceholderType
PlaceholderType
An enumeration of the types of placeholders. PredefinedLayout
PredefinedLayout
An enumeration of the predefined layouts. SelectionType
SelectionType
An enumeration of the types of selections. ShapeType
ShapeType
An enumeration of the types of shapes. SheetsChartEmbedType
SheetsChartEmbedType
An enumeration of Sheets chart embed types. SlideLinkingMode
SlideLinkingMode
An enumeration of the ways Slides can be linked. SlidePosition
SlidePosition
An enumeration of the types of slide positions. SpacingMode
SpacingMode
An enumeration of the types of spacing modes. TextBaselineOffset
TextBaselineOffset
An enumeration of the types of text baseline offset. TextDirection
TextDirection
An enumeration of the types of text directions. ThemeColorType
ThemeColorType
An enumeration of theme colors. VideoSourceType
VideoSourceType
An enumeration of the types of video source. Methods Detailed documentation create(name)
Creates and opens a new Presentation
.
name
String
The name to be given to the created presentation. Return
Presentation
— the presentation with the given name.
Scripts that use this method require authorization with one or more of the following scopes:
https://www.googleapis.com/auth/presentations
getActivePresentation()
Returns the currently active presentation to which the script is container-bound, or null
if there is no active presentation. To interact with a presentation to which the script is not container-bound, use openById(id)
instead.
// Get the current presentation to which this script is bound. const presentation = SlidesApp.getActivePresentation();
If the presentation is already open, the same presentation instance is returned.
Return AuthorizationScripts that use this method require authorization with one or more of the following scopes:
https://www.googleapis.com/auth/presentations.currentonly
https://www.googleapis.com/auth/presentations
getUi()
Returns an instance of the presentation's user-interface environment that allows the script to add features like menus, dialogs, and sidebars. A script can only interact with the UI for the current instance of an open presentation, and only if the script is bound to the presentation. For more information, see the guides to menus and dialogs and sidebars.
// Add a custom menu to the active presentation, including a separator and a // sub-menu. function onOpen(e) { SlidesApp.getUi() .createMenu('My Menu') .addItem('My menu item', 'myFunction') .addSeparator() .addSubMenu( SlidesApp.getUi() .createMenu('My sub-menu') .addItem('One sub-menu item', 'mySecondFunction') .addItem('Another sub-menu item', 'myThirdFunction'), ) .addToUi(); }Return
newAffineTransformBuilder()
openById(id)
Opens the Presentation
with the given ID.
// Open a presentation by ID. const presentation = SlidesApp.openById('docId');
If the presentation is already open, the same presentation instance is returned.
Parameters Name Type Descriptionid
String
Return
Presentation
— the presentation with the given ID
Scripts that use this method require authorization with one or more of the following scopes:
https://www.googleapis.com/auth/presentations
openByUrl(url)
Opens the Presentation
with the given URL.
// Open a presentation by URL. const presentation = SlidesApp.openByUrl( 'https://docs.google.com/presentation/d/docId/edit', );
If the presentation is already open, the same presentation instance is returned.
Parameters Name Type Descriptionurl
String
Return
Presentation
— the presentation with the given URL
Scripts that use this method require authorization with one or more of the following scopes:
https://www.googleapis.com/auth/presentations
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-12-02 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-12-02 UTC."],[[["The `SlidesApp` class allows you to programmatically create and manipulate Google Slides presentations using Apps Script."],["You can open existing presentations using their ID or URL, or create new ones with a specified name."],["`SlidesApp` provides access to various properties and methods for interacting with presentation elements like shapes, text, and slides."],["It includes numerous enumerations for things like alignment, color types, and shape types to assist in customization."],["`SlidesApp` also offers functionalities like getting the active presentation, building affine transformations, and accessing the user interface environment for adding menus and dialogs."]]],["SlidesApp facilitates the creation and management of presentations. Key actions include creating a new presentation using `create(name)`, opening existing presentations via `openById(id)` or `openByUrl(url)`, and retrieving the active presentation with `getActivePresentation()`. It also allows for building Affine Transforms and returns a Ui instance to modify the UI of a presentation. The class defines numerous enums related to the properties of the presentation including alignments, styles, types, and presets.\n"]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4