วงจรการอัปเดตงานนำเสนอ
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
วงจรของออบเจ็กต์
งานนำเสนอมี 3 ระยะหลักๆ ได้แก่ การเปิด
การแก้ไข และการบันทึก
การเปิดงานนำเสนอ
เมื่อใช้บริการสไลด์ ขั้นตอนแรกคือการโหลดงานนำเสนอ เมธอด
เช่น SlidesApp.openById()
และ SlidesApp.getActivePresentation()
จะโหลดงานนำเสนอที่มีอยู่ของสไลด์ ส่วน
SlidesApp.create()
จะสร้างงานนำเสนอใหม่ เมธอดเหล่านี้จะแสดงผลออบเจ็กต์
Presentation ที่
แสดงถึงงานนำเสนอที่โหลด
เมื่อเปิดงานนำเสนอแล้ว งานนำเสนอจะไม่ได้รับการอัปเดตเพิ่มเติมจากผู้ทำงานร่วมกัน โดยปกติแล้ว ระบบจะเปิดงานนำเสนอในเวอร์ชันล่าสุดที่บันทึกไว้ในไดรฟ์ อย่างไรก็ตาม หากสคริปต์เชื่อมโยงกับคอนเทนเนอร์ของงานนำเสนอ
ระบบจะโหลดงานนำเสนอในเวอร์ชันเดียวกับโปรแกรมแก้ไขสไลด์
ที่มาพร้อมกัน
การแก้ไขงานนำเสนอ
เมื่อเปิดงานนำเสนอแล้ว สคริปต์จะอ่านและแก้ไขงานนำเสนอได้ การเปลี่ยนแปลงใดๆ ที่สคริปต์ทำกับงานนำเสนอจะแสดงในการอ่านและการแก้ไขในภายหลังตลอดระยะเวลาที่สคริปต์ทำงาน
กำลังบันทึกการเปลี่ยนแปลง
หลังจากทำการเปลี่ยนแปลงในงานนำเสนอแล้ว ระบบจะบันทึกการเปลี่ยนแปลงทั้งหมดพร้อมกัน
เมื่อการดำเนินการสคริปต์เสร็จสมบูรณ์ หรือเมื่อมีการเรียกใช้ Presentation.saveAndClose()
หลังจากบันทึกการเปลี่ยนแปลงแล้ว ระบบจะเผยแพร่การเปลี่ยนแปลงแบบไม่พร้อมกันไปยังเอดิเตอร์ของผู้ใช้ ราวกับว่าการเปลี่ยนแปลงนั้นเกิดจากผู้ทำงานร่วมกัน
หลังจากปิดงานนำเสนอโดยใช้ Presentation.saveAndClose()
คุณจะ
เปิดงานนำเสนออีกครั้งเพื่อแก้ไขได้โดยใช้วิธีการโหลดงานนำเสนอวิธีใดวิธีหนึ่ง
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-31 UTC
[null,null,["อัปเดตล่าสุด 2025-08-31 UTC"],[[["\u003cp\u003eThe Slides service allows you to open existing or create new Google Slides presentations for manipulation within Apps Script.\u003c/p\u003e\n"],["\u003cp\u003eScripts can modify presentations, with changes reflected immediately within the script but saved and propagated to the editor upon script completion or explicit save.\u003c/p\u003e\n"],["\u003cp\u003eSaving changes to a presentation is done automatically at the end of script execution or manually using \u003ccode\u003ePresentation.saveAndClose()\u003c/code\u003e, after which the presentation can be reopened.\u003c/p\u003e\n"]]],[],null,["# Life cycle of a presentation update\n\nThere are three main phases in the life cycle of a\n[Presentation](/apps-script/reference/slides/presentation) object: opening,\nediting, and saving.\n\nOpening a presentation\n----------------------\n\nWhen using the Slides Service, the first step is to load a presentation. Methods\nlike [SlidesApp.openById()](/apps-script/reference/slides/slides-app#openbyidid)\nand [SlidesApp.getActivePresentation()](/apps-script/reference/slides/slides-app#getactivepresentation)\nload an existing Slides presentation, while\n[SlidesApp.create()](/apps-script/reference/slides/slides-app#createname)\ncreates a new presentation. These methods return a\n[Presentation](/apps-script/reference/slides/presentation) object that\nrepresents the loaded presentation.\n\nOnce a presentation is open, it does not receive any further updates from\ncollaborators. Presentations are usually opened at their latest version that has\nbeen saved in Drive. However, if a script is container-bound to a presentation,\nthat presentation will be loaded at the same version as the accompanying Slides\neditor.\n\nModifying a presentation\n------------------------\n\nOnce a presentation is open, a script can read and modify it. Any changes that\nthe script makes to the presentation are reflected in subsequent reads and\nmodifications for the duration of the script execution.\n\nSaving changes\n--------------\n\nAfter making changes to a presentation, the changes are saved all at once\nwhen the script execution completes, or when [Presentation.saveAndClose()](/apps-script/reference/slides/presentation#saveandclose) is\ncalled. After changes are saved, they propagate asynchronously to the\nuser's editor, as if the changes were made by a collaborator.\n\nAfter a presentation is closed using `Presentation.saveAndClose()`, it can be\nreopened for editing using one of the presentation loading methods."]]