通过Google应用脚本访问Google文档评论 [英] Access Google docs comments from Google app scripts
问题描述
我正在与几个人同时编写google文档,为了跟踪谁必须做,我在使用注释.
I am writing google docs with several people at the same time and in order to track who has to do what, I am using comments.
然后将文档的每个部分分配给某人,他必须在注释中(以结构化格式)更新其部分的状态.
Each part of the document is then assigned to someone and he has to update the status of his part in the comment (in a structured format).
感谢VBA中的宏,我将其提取出来并将结果放入电子表格中.这样就很容易跟踪文档的状态.
Thanks to a Macro in VBA, I extract this and put the results in a spreadsheet. It's then easy to track the status of the document.
在MS Word中很容易做到,但在Google文档中却不那么容易.我找不到从Google应用程序脚本访问评论的任何方法.
It's something easy to do in MS Word but not in Google docs. I can't find any way to access the comments from a google app script.
你知道这种方式是否存在吗?
Do you know if such way exist?
类似于Document.getBody().getComments().
Something like Document.getBody().getComments().
如果您有任何解决方案,我很高兴知道,因为我在网上一无所有.
If you have any solution, I would be happy to know as I can't anything on the net.
谢谢.
-
皮埃尔
推荐答案
谢谢.同时,我在API中找到了一些内容.
Thanks. I found something in the API in the meantime.
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.');
}
}
这篇关于通过Google应用脚本访问Google文档评论的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!