LANG SELRCT

Apps Script Reference  (Create: Create new Spreadsheet | Create new Apps Script

Wednesday, October 21, 2020

showModalDialogでスプレッドシート上にUIを表示する


MISSION 
showModalDialogでスプレッドシート上にUIを表示する



以下のコード.gsのmyFunction()をスクリプトエディタで実行すると
このようなUIを表示できます。


UIを表示すると背後のシートは操作できません。



コード.gs 
function myFunction() {
  const htmlOutput = HtmlService
      .createHtmlOutput('<p>ここに表示したい内容をhtmlで書ける。</p><br><a href="https://www.google.com/">リンクもはれる</a>')
      .setWidth(360)
      .setHeight(120);
  SpreadsheetApp.getUi().showModalDialog(htmlOutput, "MyGUI");
}


Latest post

Creating a template copier app in Google Apps Script

Introduction This article will show you a template copier application in Google Apps Script.  This application will automatically copy a t...