【问题标题】:Insert Image to Google Docs Menu将图像插入 Google 文档菜单
【发布时间】:2016-03-30 15:26:40
【问题描述】:

我在工具栏上创建了一个新的子菜单。我希望有几个下拉项目,每个项目都有自己分配的图像,这样当有人点击他们的名字时,驱动器中的关联图像会自动出现在单元格中。我该怎么做呢?这是我目前所拥有的:

    function onOpen() {
      var ui = SpreadsheetApp.getUi();
      // Or DocumentApp or FormApp.
      ui.createMenu('Supervisor Signatures')
      .addItem('First item', 'menuItem1')
      .addSeparator()
      .addSubMenu(ui.createMenu('Sub-menu')
          .addItem('Second item', 'menuItem2'))
      .addToUi();
     }

function menuItem1() {
  SpreadsheetApp.getUi() // Or DocumentApp or FormApp.
     .alert('You clicked the first menu item!');
}

function menuItem1() {
  SpreadsheetApp.getUi() // Or DocumentApp or FormApp.
     .alert('You clicked the first menu item!');
}

【问题讨论】:

    标签: google-spreadsheet-api


    【解决方案1】:

    环顾社区,在Using Google Script, how can I insert an image into a table cell? 上找到了这篇帖子。

    答案只是提到只需执行一个将单元格公式设置为的函数-- =Image(<insert-image-url-here>) getRange(<insert-cell-here>).setFormula();

    关于使用云端硬盘中的图片,这里有一个简单快捷的指南,告诉你如何使用Get Images from Google Drive

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-07-11
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多