メインコンテンツまでスキップ

Show.Comment

Show.Comment は Presentation モジュール(Office.show(iframe))のオブジェクト型です。メソッド 14 個。

備考​

メソッド​

メソッド説明
appendText(text)コメントのテキストの末尾に追加します。
getAuthorName()コメントの作成者名を返します。
getDateTime()コメントの作成日時を返します。
getParent()このコメントの親コメントを返します。
getPosition()コメントアイコンのスライド基準の位置を返します。
getReplies()このコメントの返信の一覧を返します。
getStyle()コメントのスタイルを返します。
getText()コメントのテキストを返します。
hasReplies()返信が 1 つでもあるかどうかを返します。
isReply()このコメントが返信かどうかを返します。
moveBy(distance)コメントを x、y だけ相対移動します。
setPosition(position)コメントをスライド基準の絶対位置へ移動します。
setStyle(style)コメントのスタイルを変更します。
setText(text)コメントのテキストを設定します。

メソッドの詳細​

appendText(text)​

コメントのテキストの末尾に追加します。

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

パラメーター

名前型説明
textstring追加するテキスト

戻り値

none

getAuthorName()​

コメントの作成者名を返します。

getAuthorName(): Promise<string | null>;

戻り値

Promise<string | null> - 作成者名(作成者の情報がない場合は空文字列)。対象のコメントがない場合は null

getDateTime()​

コメントの作成日時を返します。

getDateTime(): Promise<string | null>;

戻り値

Promise<string | null> - 作成日時 'YYYY-MM-DDTHH:mm:ss.SSS'。対象のコメントがない場合は null

getParent()​

このコメントの親コメントを返します。

getParent(): Promise<Comment>;

戻り値

Promise<Comment> - 親コメント。返信ではない場合や対象のコメントがない場合は null

getPosition()​

コメントアイコンのスライド基準の位置を返します。

getPosition(): Promise<CommentPosition | null>;

戻り値

Promise<CommentPosition | null> - コメントアイコンの位置(px 単位)。対象のコメントがない場合は null

getReplies()​

このコメントの返信の一覧を返します。

getReplies(): Promise<Comment[]>;

戻り値

Promise<Comment[]> - 返信の一覧。対象のコメントがない場合は空の配列

getStyle()​

コメントのスタイルを返します。(setStyle と対称)スタイルを指定したことがないコメントも、作成者ごとの既定のスタイルで返されます。

getStyle(): Promise<CommentStyle | null>;

戻り値

Promise<CommentStyle | null> - コメントのスタイル。対象のコメントがない場合やプリセット外のスタイルの場合は null

getText()​

コメントのテキストを返します。

getText(): Promise<string | null>;

戻り値

Promise<string | null> - コメントのテキスト。対象のコメントがない場合は null

hasReplies()​

返信が 1 つでもあるかどうかを返します。

hasReplies(): Promise<boolean | null>;

戻り値

Promise<boolean | null> - 返信がある場合は true。対象のコメントがない場合は null

isReply()​

このコメントが返信かどうかを返します。

isReply(): Promise<boolean | null>;

戻り値

Promise<boolean | null> - 返信の場合は true。対象のコメントがない場合は null

moveBy(distance)​

コメントを x、y だけ相対移動します。

moveBy(distance: { x: number; y: number }): Promise<void>;

パラメーター

名前型説明
distance{ x: number; y: number }移動量(px 単位)。正の値 = 右/下

戻り値

none

setPosition(position)​

コメントをスライド基準の絶対位置へ移動します。(相対移動は moveBy)

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

パラメーター

名前型説明
positionPartial<CommentPosition>{ x, y }(px 単位の絶対座標)。省略した軸は現在の値を維持

戻り値

none

setStyle(style)​

コメントのスタイルを変更します。(getStyle と対称)

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

パラメーター

名前型説明
styleCommentStyleコメントのスタイル

戻り値

none

setText(text)​

コメントのテキストを設定します。(既存の内容は置き換えられます)

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

パラメーター

名前型説明
textstringコメントのテキスト

戻り値

none