ExcelScript.Comment interface
Represents a comment in the workbook.
Methods
add |
Creates a comment reply for a comment. |
delete() | Deletes the comment and all the connected replies. |
get |
Gets the email of the comment's author. |
get |
Gets the name of the comment's author. |
get |
Returns a comment reply identified by its ID. If the comment reply object does not exist, then this method returns |
get |
The comment's content. The string is plain text. |
get |
Gets the content type of the comment. |
get |
Gets the creation time of the comment. Returns |
get |
Specifies the comment identifier. |
get |
Gets the cell where this comment is located. |
get |
Gets the entities (e.g., people) that are mentioned in comments. |
get |
Represents a collection of reply objects associated with the comment. |
get |
The comment thread status. A value of |
get |
Gets the rich comment content (e.g., mentions in comments). This string is not meant to be displayed to end-users. Your add-in should only use this to parse rich comment content. |
set |
The comment's content. The string is plain text. |
set |
The comment thread status. A value of |
update |
Updates the comment content with a specially formatted string and a list of mentions. |
Method Details
addCommentReply(content, contentType)
Creates a comment reply for a comment.
addCommentReply(
content: CommentRichContent | string,
contentType?: ContentType
): CommentReply;
Parameters
- content
-
ExcelScript.CommentRichContent | string
The comment's content. This can be either a string or a CommentRichContent
object (e.g., for comments with mentions).
- contentType
- ExcelScript.ContentType
Optional. The type of content contained within the comment. The default value is enum ContentType.Plain
.
Returns
delete()
Deletes the comment and all the connected replies.
delete(): void;
Returns
void
getAuthorEmail()
Gets the email of the comment's author.
getAuthorEmail(): string;
Returns
string
getAuthorName()
Gets the name of the comment's author.
getAuthorName(): string;
Returns
string
getCommentReply(commentReplyId)
Returns a comment reply identified by its ID. If the comment reply object does not exist, then this method returns undefined
.
getCommentReply(commentReplyId: string): CommentReply | undefined;
Parameters
- commentReplyId
-
string
The identifier for the comment reply.
Returns
ExcelScript.CommentReply | undefined
getContent()
The comment's content. The string is plain text.
getContent(): string;
Returns
string
getContentType()
Gets the content type of the comment.
getContentType(): ContentType;
Returns
getCreationDate()
Gets the creation time of the comment. Returns null
if the comment was converted from a note, since the comment does not have a creation date.
getCreationDate(): Date;
Returns
Date
getId()
Specifies the comment identifier.
getId(): string;
Returns
string
getLocation()
getMentions()
Gets the entities (e.g., people) that are mentioned in comments.
getMentions(): CommentMention[];
Returns
getReplies()
Represents a collection of reply objects associated with the comment.
getReplies(): CommentReply[];
Returns
getResolved()
The comment thread status. A value of true
means that the comment thread is resolved.
getResolved(): boolean;
Returns
boolean
getRichContent()
Gets the rich comment content (e.g., mentions in comments). This string is not meant to be displayed to end-users. Your add-in should only use this to parse rich comment content.
getRichContent(): string;
Returns
string
setContent(content)
The comment's content. The string is plain text.
setContent(content: string): void;
Parameters
- content
-
string
Returns
void
setResolved(resolved)
The comment thread status. A value of true
means that the comment thread is resolved.
setResolved(resolved: boolean): void;
Parameters
- resolved
-
boolean
Returns
void
updateMentions(contentWithMentions)
Updates the comment content with a specially formatted string and a list of mentions.
updateMentions(contentWithMentions: CommentRichContent): void;
Parameters
- contentWithMentions
- ExcelScript.CommentRichContent
The content for the comment. This contains a specially formatted string and a list of mentions that will be parsed into the string when displayed by Excel.
Returns
void
Office Scripts