The Comment option allows you to leave comments on the specific words, phrases, sentences and other document parts, edit and remove these comments. All the comments will be saved and shown to other document users.
In order to enable the comment option, the comment parameter in the permissions section of the document initialization must be set to true. The document side bar will contain the Comment menu option.
In case the edit parameter is set to true and the comment parameter is also set to true, the user will be able to edit the document and comment.
In case the edit parameter is set to false and the comment parameter is set to true, the document will be available for commenting only.
var docEditor = new DocsAPI.DocEditor("placeholder", { "document": { "permissions": { "edit": false, "comment": true ... }, ... }, ... });
If you want to allow editing comments only by their authors, set the editCommentAuthorOnly parameter in the permissions section of the editor initialization to true.
var docEditor = new DocsAPI.DocEditor("placeholder", { "document": { "permissions": { "editCommentAuthorOnly": true ... }, ... }, ... });
If you want to allow deleting comments only by their authors, set the deleteCommentAuthorOnly parameter in the permissions section of the editor initialization to true.
var docEditor = new DocsAPI.DocEditor("placeholder", { "document": { "permissions": { "deleteCommentAuthorOnly": true ... }, ... }, ... });
Specify the group (or several groups separated with commas) the user belongs to by adding the field group to the user parameter in the editorConfig section.
var docEditor = new DocsAPI.DocEditor("placeholder", { "editorConfig": { "user": { "id": "78e1e841", "name": "John Smith", "group": "Group1,Group2" } }, ... }); var docEditor = new DocsAPI.DocEditor("placeholder", { "editorConfig": { "user": { "id": "F89d8069ba2b", "name": "Kate Cage", "group": "Group2" } }, ... });
Specify the access rights using the commentGroups parameter in the permissions section of the editor initialization.
var docEditor = new DocsAPI.DocEditor("placeholder", { "document": { "permissions": { "commentGroups": { "edit": ["Group2", ""], "remove": [""], "view": "" }, ... } ... }, ... });
To display ONLYOFFICE spreadsheet comments in other editors correctly, all the comments are saved in two formats - original and threaded:
The original comment format looks as follows:
${author1}: comment ${author2}: reply1 ${author2}: reply2
The file in the editors opens as follows: