您可以使用 Google Apps Script,透過 Slides 服務以程式輔助方式建立及修改 Google 簡報。您可以使用 Apps Script 在 Google 簡報中新增自訂選單、對話方塊和側欄。您也可以將 Google 簡報與其他Google 服務 (例如日曆、雲端硬碟和 Gmail) 整合。
開始使用
Apps Script 內建服務,可讓您以程式輔助方式建立、讀取及編輯 Google 簡報。Apps Script 可透過兩種方式與 Google 簡報互動:
只要使用者具備適當的簡報存取權限,任何指令碼都能建立新簡報或存取現有簡報。
指令碼可以繫結至簡報,這樣指令碼就能更直接存取該簡報的 Google 簡報使用者介面。如要建立繫結指令碼,請在 Google 簡報中依序選取「擴充功能」>「Apps Script」。
自訂選單和使用者介面
你可以新增自訂選單、對話方塊和側欄,自訂 Google 簡報。如要瞭解建立選單的基本概念,請參閱選單指南。如要瞭解如何自訂對話方塊內容,請參閱 HTML 服務指南。
如果您打算將自訂介面發布為外掛程式,請遵循樣式指南,確保介面與 Google 簡報編輯器的樣式和版面配置一致。
Google 簡報外掛程式
外掛程式是特別封裝的 Apps Script 專案,可在 Google 簡報中執行,並從 Google 簡報外掛程式商店安裝。如果您已開發 Google 簡報的指令碼,並想與他人分享,可以透過 Apps Script 將指令碼發布為外掛程式,讓其他使用者從外掛程式商店安裝。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-08-31 (世界標準時間)。"],[[["\u003cp\u003eGoogle Apps Script enables programmatic creation and modification of Google Slides presentations.\u003c/p\u003e\n"],["\u003cp\u003eApps Script allows customization of Google Slides through custom menus, dialogs, and sidebars, and integration with other Google services.\u003c/p\u003e\n"],["\u003cp\u003eScripts can be bound to a presentation for direct access to the Slides user interface or used independently with appropriate permissions.\u003c/p\u003e\n"],["\u003cp\u003eApps Script projects can be packaged and published as add-ons, extending Google Slides functionality for other users.\u003c/p\u003e\n"]]],[],null,["# Extending Google Slides\n\nGoogle Apps Script lets you programmatically create and modify Google Slides\npresentations using the\n[Slides service](/apps-script/reference/slides/slides-app).\nYou can use Apps Script to add [custom menus](/apps-script/guides/menus),\n[dialogs, and sidebars](/apps-script/guides/dialogs) to Slides. You\ncan also integrate Slides with other\n[Google services](/apps-script/guides/services) like Calendar, Drive, and\nGmail.\n| **Note:** The [Slides service](/apps-script/reference/slides/slides-app) is the recommended way of working with Google Slides in Apps Script. You can also enable the [Slides advanced service](/apps-script/advanced/slides) if you need to invoke the [Slides API](/slides) directly.\n\nGet started\n-----------\n\nApps Script includes a\n[built-in service](/apps-script/reference/slides/slides-app)\nthat lets you programmatically create, read, and edit Google Slides.\nApps Script can interact with Google Slides in two ways:\n\n1. Any script can create a new presentation or access an existing presentation if the user has the appropriate access permissions for that presentation.\n2. A script can be [bound](/apps-script/guides/bound) to a presentation, which provides the script more direct access to the Slides user interface for that script. To create a bound script, select **Extensions** \\\u003e **Apps Script** from within Google Slides.\n\nCustom menus and user interfaces\n--------------------------------\n\nYou can customize Google Slides by adding custom menus, dialog boxes, and\nsidebars. To learn the basics of creating menus, see the\n[guide to menus](/apps-script/guides/menus). To learn about customizing the\ncontent of a dialog box, see the\n[guide to HTML service](/apps-script/guides/html#serve_html_as_a_google_docs_sheets_or_forms_user_interface).\n\nIf you're planning to publish your custom interface as part of an\n[add-on](#add-ons), follow the\n[style guide](/workspace/add-ons/guides/editor-style) for consistency with the\nstyle and layout of the Google Slides editor.\n\nadd-ons for Google Slides\n-------------------------\n\n[add-ons](/workspace/add-ons/overview) are specially packaged Apps Script\nprojects that run inside Google Slides and can be installed\nfrom the Google Slides add-on store. If you've developed a script for Google Slides and want to share it with the world, Apps Script lets you\n[publish](/workspace/add-ons/how-tos/editor-publish-overview) your script as an\nadd-on so other users can install it from the add-on store.\n\nSee the\n[sample translate add-on](/workspace/add-ons/editors/slides/quickstart/translate)\nor\n[sample progress bar add-on](/workspace/add-ons/editors/slides/quickstart/progress-bar)\nfor examples of Slides add-ons."]]