【问题标题】:Access Google docs comments from Google app scripts从 Google 应用脚本访问 Google 文档评论
【发布时间】:2018-06-18 15:48:24
【问题描述】:

我正在与几个人同时编写谷歌文档,为了跟踪谁必须做什么,我正在使用 cmets。

然后将文档的每个部分分配给某人,他必须在评论中更新其部分的状态(以结构化格式)。

感谢 VBA 中的宏,我将其提取出来并将结果放入电子表格中。
然后很容易跟踪文档的状态。

这在 MS Word 中很容易做到,但在 Google 文档中却不是。我找不到从谷歌应用脚​​本访问 cmets 的任何方法。

你知道这种方式是否存在吗?

类似Document.getBody().getComments()

如果您有任何解决方案,我会很高兴知道,因为我无法在网上找到任何东西。

【问题讨论】:

标签: google-apps-script google-docs


【解决方案1】:

谢谢。与此同时,我在 API 中发现了一些东西。

function listComments() {
  var comments = Drive.Comments.list(DocumentApp.getActiveDocument().getId());

  if (comments.items && comments.items.length > 0) {
    for (var i = 0; i < comments.items.length; i++) {
      var comment = comments.items[i];  
      Logger.log('Comment : %s', comment.toLocalString());
    }
  } else {
    Logger.log('No comment found.');
  }
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-10-01
    • 2014-04-15
    • 1970-01-01
    • 1970-01-01
    • 2018-12-03
    • 2021-03-20
    • 1970-01-01
    相关资源
    最近更新 更多