從 Gemini 要把對話匯成 Docs 時,常常會發生排版不如預期的情況,這時候可以透過清除格式來重置整份文件後,再依需求去進行排版設計
清除格式快捷鍵為 Ctrl + 反斜線 \
~楓花雪岳~
星期六, 9月 05, 2026
星期三, 9月 02, 2026
[GAS] 自訂側欄
用 agy 寫網頁應用程式時,AI 自行在 Google Sheet 內設計 sidebar 來呈現網頁應用程式,那就來筆記 sidebar 效果囉
code.gs
gs code 內的 OnOpen() 在 Google Sheet 開啟時會有自訂功能
透過 sidebar 開啟 sitebar.html 網頁
code.gs
/**
* 當試算表開啟時,自動新增自訂功能表
*/
function onOpen() {
SpreadsheetApp.getUi()
.createMenu('🛠️ 自訂功能')
.addItem('開啟側邊欄', 'showSidebar')
.addToUi();
}
/**
* 載入 Sidebar.html 並在右側開啟側邊欄
*/
function showSidebar() {
const htmlOutput = HtmlService.createHtmlOutputFromFile('Sidebar')
.setTitle('側邊欄說明')
.setWidth(300); // 側邊欄預設寬度通常為 300px
SpreadsheetApp.getUi().showSidebar(htmlOutput);
}
sidebar.html
<!DOCTYPE html>
<html>
<head>
<base target="_top">
<!-- 引入 Google Material/標準風格樣式簡潔化介面 -->
<link rel="stylesheet" href="https://ssl.gstatic.com/docs/script/css/add-ons1.css">
<style>
body {
padding: 12px;
font-family: Arial, sans-serif;
color: #333;
line-height: 1.5;
}
.card {
background-color: #f8f9fa;
border: 1px solid #dadce0;
border-radius: 8px;
padding: 12px;
margin-bottom: 12px;
}
h2 {
margin-top: 0;
color: #1a73e8;
font-size: 18px;
}
ul {
padding-left: 20px;
margin: 8px 0;
}
li {
margin-bottom: 6px;
}
.footer {
font-size: 12px;
color: #70757a;
margin-top: 20px;
border-top: 1px solid #eee;
padding-top: 8px;
}
</style>
</head>
<body>
<h2>📌 側邊欄功能說明</h2>
<div class="card">
<p>歡迎使用自訂側邊欄!這是一個透過 <code>HtmlService</code> 建立的客製化介面。</p>
</div>
<h3>主要特色</h3>
<ul>
<li><strong>即時操作:</strong> 不影響目前試算表的編輯流程。</li>
<li><strong>雙向溝通:</strong> 可透過 <code>google.script.run</code> 與後端 Apps Script 進行資料交換。</li>
<li><strong>豐富介面:</strong> 支援 HTML5、CSS3 及 JavaScript 各種前端框架。</li>
</ul>
<div class="footer">
💡 提示:點擊右上角「✕」即可隨時關閉此側邊欄。
</div>
</body>
</html>
gs code 內的 OnOpen() 在 Google Sheet 開啟時會有自訂功能
透過 sidebar 開啟 sitebar.html 網頁
星期二, 9月 01, 2026
[GAS] 網頁應用程式-執行身分、誰可以存取
透過 clasp 來進行部屬時發現 clasp deploy 部屬網頁應用程式,是沒有參數可以指定 [執行身分] 和 [誰可以存取],查發現這兩個設定是要在 appsscript.json 內進行設定
appsscript.json 內的執行身分 (executeAs) 和 誰可以存取 (access)
{
"timeZone": "Asia/Taipei",
"dependencies": {},
"exceptionLogging": "STACKDRIVER",
"runtimeVersion": "V8",
"webapp": {
"executeAs": "USER_DEPLOYING",
"access": "MYSELF"
}
}
access 參數- MYSELF:只有部署者可以執行
- ANYONE:任何登入 Google 帳號的使用者
- ANYONE_ANONYMOUS:任何使用者,即使未登入也適用
- DOMAIN:只有與部署者位於相同網域的使用者才能執行(限 Google Workspace)
- USER_ACCESSING:網頁應用程式會以存取者的身分執行
- USER_DEPLOYING:網頁應用程式會以部署者的身分執行
星期一, 8月 31, 2026
星期二, 8月 25, 2026
[Word] Word 無法啟動 (24)
使用者回報,開啟 Word 檔案時都會出現錯誤訊息,但檔案是打得開,如下圖
在該 討論 發現,原來是檔案總管的預覽視窗造成,關閉預覽視窗就恢復正常
軟體相關資訊:
在該 討論 發現,原來是檔案總管的預覽視窗造成,關閉預覽視窗就恢復正常
軟體相關資訊:
- OS:Win11 25H2
- Office:2013 (15.0.5603.1000)
訂閱:
文章 (Atom)




