ApiComment

new ApiComment()

Class representing a comment.

Properties

Name Type Description
Text string

Returns or sets the comment text.

Id string

Returns the current comment ID.

AuthorName string

Returns or sets the comment author's name.

UserId string

Returns or sets the user ID of the comment author.

Solved boolean

Checks if a comment is solved or not or marks a comment as solved.

TimeUTC number | string

Returns or sets the timestamp of the comment creation in UTC format.

Time number | string

Returns or sets the timestamp of the comment creation in the current time zone format.

QuoteText string

Returns the quote text of the current comment.

RepliesCount Number

Returns a number of the comment replies.

Methods

Name Description
AddReply

Adds a reply to a comment.

Delete

Deletes the ApiComment object.

GetAuthorName

Returns the comment author's name.

GetClassType

Returns a type of the ApiComment class.

GetId

Returns the current comment ID.

GetQuoteText

Returns the quote text of the current comment.

GetRepliesCount

Returns a number of the comment replies.

GetReply

Returns the specified comment reply.

GetText

Returns the comment text.

GetTime

Returns the timestamp of the comment creation in the current time zone format.

GetTimeUTC

Returns the timestamp of the comment creation in UTC format.

GetUserId

Returns the user ID of the comment author.

IsSolved

Checks if a comment is solved or not.

RemoveReplies

Removes the specified comment replies.

SetAuthorName

Sets the comment author's name.

SetSolved

Marks a comment as solved.

SetText

Sets the comment text.

SetTime

Sets the timestamp of the comment creation in the current time zone format.

SetTimeUTC

Sets the timestamp of the comment creation in UTC format.

SetUserId

Sets the user ID to the comment author.

Example

Copy code
builder.CreateFile("xlsx");
var oWorksheet = Api.GetActiveSheet();
oWorksheet.GetRange("A1").SetValue("1");
var oRange = oWorksheet.GetRange("A1");
oRange.AddComment("This is just a number.");
var oComment = oRange.GetComment();
oWorksheet.GetRange("A3").SetValue("Comment: " + oComment.GetText());
var sType = oComment.GetClassType();
oWorksheet.GetRange("A4").SetValue("Type: " + sType + " (number of comment data type)");
builder.SaveFile("xlsx", "ApiComment.xlsx");
builder.CloseFile();

Resulting document