简体   繁体   English

如何使用谷歌表格应用程序脚本在单元格上添加评论

[英]How Can I add comment on a cell using google sheet app script

How Can I add comment to google sheet using app script.如何使用应用脚本向谷歌表格添加评论。 I can add notes but i want to add comments.我可以添加注释,但我想添加评论。 tried different methods but no clue.尝试了不同的方法但没有线索。

.setcomments .setcomments

and

.getcomments .getcomments

function not even exisit. function 甚至不存在。

I achive to add a comment with:我想添加评论:

function insertDriveComment(){
  var fileId = 'your file id'
  var resource = {'content': 'Here is my comment !'};
  Drive.Comments.insert(resource, fileId)
}

you have to enable Drive API service你必须启用 Drive API 服务

or, if you use the same spreadsheet to add comments或者,如果您使用相同的电子表格添加评论

function insertDriveComment(){
  var fileId = SpreadsheetApp.getActiveSpreadsheet().getId()
  var resource = {'content': 'Here is my comment !'};
  Drive.Comments.insert(resource, fileId)
}

to enable drive api service启用驱动器 api 服务在此处输入图像描述

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我可以在应用程序脚本谷歌表中按范围获取单元格名称吗 - Can I get name of cell by range in app script google sheet Google Script,如何使用正则表达式将一行从 Sheet1 复制到 Sheet2 而不是一个单元格? - Google Script, how can I copy a row from Sheet1 to Sheet2 instead of just one cell by using regex? 使用 Google App Script 修改 Google Sheet 中的单元格 - Modify a cell in Google Sheet using Google App Script 如何使用Google App脚本获取Google表格中特定列的最后一个单元格? - How to get last cell of a particular column in google sheet using google app script? 如何使用脚本访问 Google 工作表中选定单元格旁边的单元格? - How to access the cell next to the selected cell in Google sheet using script? 使用脚本应用从Google表格中的单元格提取日期 - Pulling Date From Cell in Google Sheet Using Script App 如何使用应用程序脚本根据单元格值修改谷歌表格图表颜色 - How to modify google sheet chart color based on cell value using app script 如何使用 Google 脚本从 1 个 Google 工作表中复制特定值并粘贴到另一个工作表? - How can I copy specific values from 1 Google Sheet and paste to another Sheet using Google Script? Google表格脚本可为特定单元格添加时间 - Google Sheet Script To Add Time To Specific Cell 如何使用 Google App Script 将一个 Google Sheet 中的所有数据提取到另一个 Google Sheet Tab? - How do I pull All data in one Google Sheet to another Google Sheet Tab using Google App Script?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM