打开电子表格并添加菜单

时间:2019-02-13 08:57:06

标签: google-apps-script google-docs

我有一个要从网络应用程序打开的电子表格,然后向该电子表格添加菜单:

    function openSheet(){
      var ssCentral = SpreadsheetApp.openById("xxxxxxxxxxxxxxxxxxxxxxx");
      ssCentral.getUi()
       .createMenu('ZettaReport')
       .addItem ('Activate Reporting for a New Member','activateNewMember')
       .addToUi();
    }

点击按钮后,此函数就会由google.run.script.openSheet()调用

   <script>
     document.getElementById("submit").addEventListener("click",launchReport)
function launchReport() {
  window.open('https://docs.google.com/spreadsheets/d/xxxxxxxxxxxxxxx');
  google.script.run.openSheet();  
}

我看到菜单添加的函数没有添加。...

0 个答案:

没有答案