5

I am trying to find out to which cell a comment belongs to in Google Spreadsheet. From the API I get

{'kind': 'drive#comment',
   ...
   'anchor': '{"type":"workbook-range","uid":0,"range":"285502171"}',
   ...}

Yet I am unable to transform the integer-valued range to the appropriate cell range (i.e. A1:A2) in the spreadsheet. According to the documentation the anchor should look completely different. Based on the doc I'd assume that there is supposed to be a region class of type matrix. There is no mention of workbook-range in the doc in the first place.

Vojtech Letal
  • 2,168
  • 3
  • 13
  • 17

1 Answers1

1

Based from this SO related post,

The Anchoring Comments feature from the Google Drive API is intended for non-Google Docs editors files, not for Google Documents. Unfortunately, at this time the Document Service from Google Apps Script doesn't include a Class Comment to handle comments and discussions.

You could probably do this with non-Google editor files.

Jessica Rodriguez
  • 2,899
  • 1
  • 12
  • 27
  • I do not get the design than. If it is supposed to be used for _non-Google Docs editors files_ why does it provide comments _from_ the individual Docs? – Vojtech Letal Jun 13 '19 at 16:31
  • 1
    I am not sure, that is the best answer for the original question. The original question is about comments in a Google Spreadsheet. So this is actually a **non-Google Docs editors file** from my point of view: non-**Google Docs** specifically, it is Google Sheets. ;-) I would be very interested in finding out how that workbook-range can be decoded because of this other issue https://stackoverflow.com/questions/40839057/how-to-getcomments-from-google-sheets – Michael Paesold Oct 31 '20 at 09:25
  • And the irony in this is that Google mentions spreadsheets multiple times in the documentation for [Anchor Region Classifiers](https://developers.google.com/drive/api/guides/ref-region-classifiers). Meanwhile people have been asking about this [for over 10 years](https://issuetracker.google.com/issues/36756650). – Christian Jul 15 '23 at 14:06