constbody=DocumentApp.getActiveDocument().getActiveTab().asDocumentTab().getBody();// Insert a paragraph at the start of the document.body.insertParagraph(0,'Hello, Apps Script!');// Set the tab font to Calibri.body.editAsText().setFontFamily(DocumentApp.FontFamily.CALIBRI);// Set the first paragraph font to Arial.body.getParagraphs()[0].setFontFamily(DocumentApp.FontFamily.ARIAL);// Set "Apps Script" to Comic Sans MS.consttext='Apps Script';consta=body.getText().indexOf(text);constb=a+text.length-1;body.editAsText().setFontFamily(a,b,DocumentApp.FontFamily.COMIC_SANS_MS);
[[["容易理解","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"]],["上次更新時間:2024-12-22 (世界標準時間)。"],[[["`FontFamily` is deprecated and now uses string names for fonts instead of the enum, but remains for compatibility."],["This enum allows you to set the font for text ranges, elements, or entire Google Docs documents."],["Supported fonts include Arial, Calibri, Comic Sans MS, Times New Roman, Verdana, and many more."],["You can use methods like `setFontFamily()` within Google Apps Script to apply these fonts."]]],[]]