Word.Comment
Word.Comment is an object type of the Word module (Office.word(iframe)). 7 methods.
Remarks
- Module: Word ·
Office.word(iframe)· namespaceWord - Obtained from:
Document.getComment(commentId),Document.getComments(),Body.getComments(),Paragraph.getComments(),Range.getComments(),Range.insertComment(text, options) - Every method returns a
Promise; signatures use TypeScript notation.
Methods
| Method | Description |
|---|---|
delete() | Deletes the comment. |
exists() | Returns whether the comment exists. |
getAuthor() | Returns the comment author's name. |
getBody() | Returns the content area of the comment. |
getDate() | Returns when the comment was written, in milliseconds since 1970-01-01 UTC (the same value as Date.getTime()). |
getId() | Returns the comment ID. |
getRange() | Returns the body range the comment is attached to. |
Method details
delete()
Deletes the comment.
delete(): Promise<void>;
Returns
none
exists()
Returns whether the comment exists.
exists(): Promise<boolean>;
Returns
Promise<boolean> - true if it exists
getAuthor()
Returns the comment author's name.
getAuthor(): Promise<string | null>;
Returns
Promise<string | null> - author name, null if the comment does not exist
getBody()
Returns the content area of the comment.
getBody(): Promise<Body>;
Returns
Promise<Body> - comment body area, null if none
getDate()
Returns when the comment was written, in milliseconds since 1970-01-01 UTC (the same value as Date.getTime()).
getDate(): Promise<number | null>;
Returns
Promise<number | null> - creation time, null if the comment does not exist or has no recorded time
getId()
Returns the comment ID.
getId(): Promise<string>;
Returns
Promise<string> - comment ID
getRange()
Returns the body range the comment is attached to.
getRange(): Promise<Range>;
Returns
Promise<Range> - body range the comment is linked to