Skip to main content

Show.Comment

Show.Comment is an object type of the Presentation module (Office.show(iframe)). 14 methods.

Generated from the SDK type definitions

Presentation · 10 object types · 586 methods · namespace Show. This reference is generated from the API document artifact (sdk-api-doc.html) produced with the SDK build. Descriptions are the editor's API comments as published. Pin the SDK and Office versions together and regenerate when either changes.

Remarks

Methods

MethodDescription
appendText(text)Appends to the end of the comment text.
getAuthorName()Returns the comment author's name.
getDateTime()Returns the comment's creation time.
getParent()Returns the parent comment of this comment.
getPosition()Returns the comment note icon's position relative to the slide.
getReplies()Returns this comment's replies.
getStyle()Returns the comment note style (symmetric with setStyle).
getText()Returns the comment text.
hasReplies()Returns whether there is at least one reply.
isReply()Returns whether this comment is a reply.
moveBy(distance)Moves the comment note by x, y relative to its current position.
setPosition(position)Moves the comment note to an absolute position on the slide.
setStyle(style)Changes the comment note style (symmetric with getStyle).
setText(text)Sets the comment text.

Method details

appendText(text)

Appends to the end of the comment text.

appendText(text: string): Promise<void>;

Parameters

NameTypeDescription
textstringText to append

Returns

Promise<void>

getAuthorName()

Returns the comment author's name.

getAuthorName(): Promise<string | null>;

Returns

Promise<string | null> - author name (an empty string when there is no author information). null when there is no target comment

getDateTime()

Returns the comment's creation time.

getDateTime(): Promise<string | null>;

Returns

Promise<string | null> - creation time, 'YYYY-MM-DDTHH:mm:ss.SSS'. null when there is no target comment

getParent()

Returns the parent comment of this comment.

getParent(): Promise<Comment>;

Returns

Promise<Comment> - parent comment; null when it is not a reply or there is no target comment

getPosition()

Returns the comment note icon's position relative to the slide.

getPosition(): Promise<CommentPosition | null>;

Returns

Promise<CommentPosition | null> - position of the comment note icon (in px). null when there is no target comment

getReplies()

Returns this comment's replies.

getReplies(): Promise<Comment[]>;

Returns

Promise<Comment[]> - reply list; an empty array when there is no target comment

getStyle()

Returns the comment note style (symmetric with setStyle). A comment that never had a style set is returned with the author's default style.

getStyle(): Promise<CommentStyle | null>;

Returns

Promise<CommentStyle | null> - note style; null when there is no target comment or the style is outside the presets

getText()

Returns the comment text.

getText(): Promise<string | null>;

Returns

Promise<string | null> - comment text; null when there is no target comment

hasReplies()

Returns whether there is at least one reply.

hasReplies(): Promise<boolean | null>;

Returns

Promise<boolean | null> - true when there are replies. null when there is no target comment

isReply()

Returns whether this comment is a reply.

isReply(): Promise<boolean | null>;

Returns

Promise<boolean | null> - true when it is a reply. null when there is no target comment

moveBy(distance)

Moves the comment note by x, y relative to its current position.

moveBy(distance: Record<string, unknown>): Promise<void>;

Parameters

NameTypeDescription
distanceRecord<string, unknown>{ x, y } (distance in px). Positive = right/down

Returns

Promise<void>

setPosition(position)

Moves the comment note to an absolute position on the slide. (Relative moves via moveBy.)

setPosition(position: CommentPosition): Promise<void>;

Parameters

NameTypeDescription
positionCommentPosition{ x, y } (absolute coordinates in px). An omitted axis keeps its current value

Returns

Promise<void>

setStyle(style)

Changes the comment note style (symmetric with getStyle).

setStyle(style: CommentStyle): Promise<void>;

Parameters

NameTypeDescription
styleCommentStylenote style

Returns

Promise<void>

setText(text)

Sets the comment text. (Existing content is replaced.)

setText(text: string): Promise<void>;

Parameters

NameTypeDescription
textstringComment text

Returns

Promise<void>