Creating anchored comments in Google Docs - any update since 2016?

605 views
Skip to first unread message

Joshua Porter

unread,
Jun 5, 2023, 10:08:18 AM6/5/23
to Google Apps Script Community
Hi there,

Is anyone aware if it is now possible to insert anchored comments to a Google Doc from Apps Script?

Comments created in the UI clearly have a anchor=kix.XXXXXXX anchor when using Drive.Comments.list('FILE_ID') but when using Drive.Comments.insert(commentObject, 'FILE_ID') , the added comments appear in the document but aren't linked to any specific part of the document.

I've tried using this parameter in the object, but without success so far: "anchor": {
'r': 'head',
'a':
{
'text':
{
'o': 5,
'l': 4
}
},
}

This thread from 2016 claims that there is no way to set anchors for new comments, however I haven't found any more recent articles: https://stackoverflow.com/questions/23498275/creating-anchored-comments-programmatically-in-google-docs

Apps Script documentation doesn't specifically disqualify Google Docs from the instructions on how to create comments:
1. https://developers.google.com/drive/api/reference/rest/v2/comments

I would be grateful for any help!

Vikram Aruchamy

unread,
Jun 23, 2023, 8:11:22 AM6/23/23
to Google Apps Script Community
I'm also looking for a solution to add an anchored comment to Google docs. Any help would be appreciated. 

James Fyfe

unread,
Jan 6, 2025, 11:57:46 PMJan 6
to Google Apps Script Community
Hey Joshua & Vikram, Did you ever find a solution for this?
Reply all
Reply to author
Forward
0 new messages