Get Started
Plugins
Macros
More information

window.Asc.plugin.executeMethod ("AddComment", [args], callback)

Description

Defines the method that allows adding a comment to the document.

Usage

This method should be used in the following way:

window.Asc.plugin.executeMethod ("AddComment", [oCommentData]);
Parameters
Parameter Description Type Example
oCommentData An object which contains the comment data:
  • UserName - the comment author,
    type: string,
    example: "John Smith";
  • Text - the comment text,
    type: string,
    example: "comment";
  • Time - the time when the comment was posted (in milliseconds),
    type: string,
    example: "1662737941471";
  • Solved - specifies if the comment is resolved (true) or not (false),
    type: boolean,
    example: true;
  • Replies - an array containing the comment replies represented as the oCommentData objects,
    type: array of objects.
object
Returns

The method returns the comment ID in the string format or null if the comment cannot be added.

Example
window.Asc.plugin.executeMethod ("AddComment", [{"UserName": "John Smith", "Text": "comment", "Time": "1662737941471", "Solved": true, "Replies": [{"UserName": "Mark Potato", "Text": "reply 1", "Time": "1662740895892", "Solved": false}]}]);