Skip to main content

Word.Comment

Word.Comment is an object type of the Word module (Office.word(iframe)). 7 methods.

Remarks​

Methods​

MethodDescription
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