GetCommentById

GetCommentById(sId) → { ApiComment }

Returns a comment from the current document by its ID.

Parameters:

Name Type Description
sId string

The comment ID.

Returns:

Type
ApiComment

Example

Copy code
builder.CreateFile("xlsx");
var oComment = Api.AddComment("Comment", "John Smith");
var sId = oComment.GetId();
oComment = Api.GetCommentById(sId);
var oWorksheet = Api.GetActiveSheet();
oWorksheet.GetRange("A1").SetValue("Commet Text: " + oComment.GetText());
oWorksheet.GetRange("A2").SetValue("Commet Author: " + oComment.GetAuthorName());
builder.SaveFile("xlsx", "GetCommentById.xlsx");
builder.CloseFile();

Resulting document