[[["เข้าใจง่าย","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-07-26 UTC"],[[["\u003cp\u003eThe DocumentTriggerBuilder helps in creating and managing triggers for Google Docs.\u003c/p\u003e\n"],["\u003cp\u003eIt provides methods like \u003ccode\u003ecreate()\u003c/code\u003e to finalize the trigger and \u003ccode\u003eonOpen()\u003c/code\u003e to set a trigger for when the document is opened.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eonOpen()\u003c/code\u003e method allows you to specify a function to execute when a document is opened, enhancing document automation capabilities.\u003c/p\u003e\n"]]],["The `DocumentTriggerBuilder` class facilitates the creation of triggers for Google Documents. Key actions include `create()`, which generates and returns a new `Trigger` object, and `onOpen()`, which configures the trigger to activate when the document is opened. The `onOpen()` method returns the `DocumentTriggerBuilder` instance, allowing method chaining. The provided example demonstrates creating a trigger that runs \"myFunction\" upon document opening.\n"],null,["DocumentTriggerBuilder\n\nA builder for document triggers. \n\nMethods\n\n| Method | Return type | Brief description |\n|-----------------------|--------------------------------------------------|-----------------------------------------------------------------|\n| [create()](#create()) | [Trigger](/apps-script/reference/script/trigger) | Creates and returns the new trigger. |\n| [onOpen()](#onOpen()) | [DocumentTriggerBuilder](#) | Specifies a trigger that will fire when the document is opened. |\n\nDetailed documentation \n\n`create()` \nCreates and returns the new trigger.\n\nReturn\n\n\n[Trigger](/apps-script/reference/script/trigger) --- The new trigger.\n\n*** ** * ** ***\n\n`on``Open()` \nSpecifies a trigger that will fire when the document is opened.\n\n```javascript\nconst document = DocumentApp.getActiveDocument();\nScriptApp.newTrigger('myFunction').forDocument(document).onOpen().create();\n```\n\nReturn\n\n\n[DocumentTriggerBuilder](#) --- This [DocumentTriggerBuilder](#), for chaining."]]