2

Google docs comment:

enter image description here

My goal is to add a text-specific comment using Google Apps Script as seen in the picture above. Right now I have this working code, but it only adds a general comment for the whole document.

function myFunction() {
  var fileId = '{FILE_ID}';
  var resource = {'content': 'comment body text'};
  Drive.Comments.insert(resource, name);
}
3
  • Is this for a custom file or a Google Apps file(like a doc or a sheet) Commented Jan 30, 2017 at 19:02
  • Google docs, yes! Commented Jan 31, 2017 at 14:23
  • 1
    As @AL. wrote it is not possible for Google App Files. Commented Jan 31, 2017 at 15:01

1 Answer 1

3

Not possible. In this video -- Google Drive SDK: Announcing the Comments API (5:30 - 5:39) -- it is mentioned that:

..We do have a proprietary anchoring scheme, which does make it difficult for, or actually rather impossible for you to create comments that are anchored to text in our document formats...

"in our document formats" refers to Google Docs and Sheets.

This is also mentioned in this answer. For more details regarding Comments, you can check the Manage Comments and Discussions documentation.

Sign up to request clarification or add additional context in comments.

2 Comments

5 years later, and this is still the case? 😫
2023 - still the case

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.