A CommentedText object represents a commented piece of text. A comment can be inserted through the context menu or programmatically.

Syntax

CommentedText

Introduced: 30.0.

Methods

Method Description
getActive Gets whether the comment is currently active or not.
getComment Retrieves the comment text.
getCreationTime Gets the date and time when the comment has been inserted as a Unix timestamp in milliseconds.
getHighlightColor Gets the highlight color for the comment as a CSS color string.
getHighlightMode Gets a value indicating whether the comment is highlighted.
getID Gets an identifier for a comment.
getLength Gets the number of characters which belong to the comment.
getNumber Gets the comment's number.
getRepliedComment Gets the comment for which this comment is a reply.
getReplies Gets all replies of this comment or null if there are no replies.
getStart Gets the index (one-based) of the first character which belongs to the comment.
getText Gets the comment's text.
getUserName Gets the name of the user who has commented the document.
scrollTo Sets the current input position to the beginning of a comment and scrolls it into the visible part of the document.
setActive Sets whether the comment is currently active or not.
setComment Sets the comment text.
setHighlightColor Sets the highlight color for the comment.
setHighlightMode Sets a value indicating whether the comment is highlighted.
setID Sets an identifier for the comment.