Excel.CommentReplyCollection class
コメントの一部であるコメント応答オブジェクトのコレクションを表します。
- Extends
注釈
プロパティ
context | オブジェクトに関連付けられている要求コンテキスト。 これにより、アドインのプロセスが Office ホスト アプリケーションのプロセスに接続されます。 |
items | このコレクション内に読み込まれた子アイテムを取得します。 |
メソッド
add(content, content |
コメントのコメント応答を作成します。 |
add(content, content |
コメントのコメント応答を作成します。 |
get |
コレクションのコメント返信数を取得します。 |
get |
その ID で識別されるコメント返信を返します。 |
get |
コレクション内の位置に基づいてコメント返信を取得します。 |
get |
その ID で識別されるコメント返信を返します。 コメント応答オブジェクトが存在しない場合、このメソッドは プロパティが に設定されたオブジェクトを |
load(options) | オブジェクトの指定されたプロパティを読み込むコマンドを待ち行列に入れます。 プロパティを読み取る前に、 |
load(property |
オブジェクトの指定されたプロパティを読み込むコマンドを待ち行列に入れます。 プロパティを読み取る前に、 |
load(property |
オブジェクトの指定されたプロパティを読み込むコマンドを待ち行列に入れます。 プロパティを読み取る前に、 |
toJSON() | API オブジェクトが に渡されたときにより便利な出力を提供するために、JavaScript |
プロパティの詳細
context
オブジェクトに関連付けられている要求コンテキスト。 これにより、アドインのプロセスが Office ホスト アプリケーションのプロセスに接続されます。
context: RequestContext;
プロパティ値
items
メソッドの詳細
add(content, contentType)
コメントのコメント応答を作成します。
add(content: CommentRichContent | string, contentType?: Excel.ContentType): Excel.CommentReply;
パラメーター
- content
-
Excel.CommentRichContent | string
コメントの内容。 これは、文字列またはオブジェクト (メンションを CommentRichContent
含むコメントの場合など) のいずれかです。 [Api set: ExcelApi 1.10 for string, 1.11 for CommentRichContent object]
- contentType
- Excel.ContentType
オプション。 コメントに含まれるコンテンツの種類。 既定値は enum です ContentType.Plain
。 [Api set: ExcelApi 1.10 for Enum ContentType.Plain, 1.11 for Enum ContentType.Mention]
戻り値
注釈
例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/12-comment/comment-replies.yaml
await Excel.run(async (context) => {
// Adds a reply to the first comment in this worksheet.
const sheet = context.workbook.worksheets.getItem("Comments");
const comment = sheet.comments.getItemAt(0);
comment.replies.add("Add content to this worksheet.");
await context.sync();
});
add(content, contentTypeString)
コメントのコメント応答を作成します。
add(content: CommentRichContent | string, contentTypeString?: "Plain" | "Mention"): Excel.CommentReply;
パラメーター
- content
-
Excel.CommentRichContent | string
コメントの内容。 これは、文字列またはオブジェクト (メンションを CommentRichContent
含むコメントの場合など) のいずれかです。 [Api set: ExcelApi 1.10 for string, 1.11 for CommentRichContent object]
- contentTypeString
-
"Plain" | "Mention"
オプション。 コメントに含まれるコンテンツの種類。 既定値は enum です ContentType.Plain
。 [Api set: ExcelApi 1.10 for Enum ContentType.Plain, 1.11 for Enum ContentType.Mention]
戻り値
注釈
getCount()
コレクションのコメント返信数を取得します。
getCount(): OfficeExtension.ClientResult<number>;
戻り値
OfficeExtension.ClientResult<number>
注釈
getItem(commentReplyId)
その ID で識別されるコメント返信を返します。
getItem(commentReplyId: string): Excel.CommentReply;
パラメーター
- commentReplyId
-
string
コメント応答の識別子。
戻り値
注釈
getItemAt(index)
コレクション内の位置に基づいてコメント返信を取得します。
getItemAt(index: number): Excel.CommentReply;
パラメーター
- index
-
number
取得するコメント応答のインデックス値。 コレクションでは、0 から始まるインデックス作成が使用されます。
戻り値
注釈
getItemOrNullObject(commentReplyId)
その ID で識別されるコメント返信を返します。 コメント応答オブジェクトが存在しない場合、このメソッドは プロパティが に設定されたオブジェクトをisNullObject
true
返します。 詳細については、「 *OrNullObject メソッドとプロパティ」を参照してください。
getItemOrNullObject(commentReplyId: string): Excel.CommentReply;
パラメーター
- commentReplyId
-
string
コメント応答の識別子。
戻り値
注釈
load(options)
オブジェクトの指定されたプロパティを読み込むコマンドを待ち行列に入れます。 プロパティを読み取る前に、context.sync()
を呼び出す必要があります。
load(options?: Excel.Interfaces.CommentReplyCollectionLoadOptions & Excel.Interfaces.CollectionLoadOptions): Excel.CommentReplyCollection;
パラメーター
読み込むオブジェクトのプロパティのオプションを提供します。
戻り値
load(propertyNames)
オブジェクトの指定されたプロパティを読み込むコマンドを待ち行列に入れます。 プロパティを読み取る前に、context.sync()
を呼び出す必要があります。
load(propertyNames?: string | string[]): Excel.CommentReplyCollection;
パラメーター
- propertyNames
-
string | string[]
読み込むプロパティを指定するコンマ区切り文字列または文字列の配列。
戻り値
load(propertyNamesAndPaths)
オブジェクトの指定されたプロパティを読み込むコマンドを待ち行列に入れます。 プロパティを読み取る前に、context.sync()
を呼び出す必要があります。
load(propertyNamesAndPaths?: OfficeExtension.LoadOption): Excel.CommentReplyCollection;
パラメーター
- propertyNamesAndPaths
- OfficeExtension.LoadOption
propertyNamesAndPaths.select
は、読み込むプロパティを指定するコンマ区切り文字列で propertyNamesAndPaths.expand
、読み込むナビゲーション プロパティを指定するコンマ区切りの文字列です。
戻り値
toJSON()
API オブジェクトが に渡されたときにより便利な出力を提供するために、JavaScript toJSON()
メソッドを JSON.stringify()
オーバーライドします。 (JSON.stringify
さらに、渡される オブジェクトの メソッドを呼び出 toJSON
します)。元 Excel.CommentReplyCollection
のオブジェクトは API オブジェクトですが、 toJSON
メソッドは、コレクションの項目から読み込まれたプロパティの浅いコピーを含む "items" 配列を含むプレーンな JavaScript オブジェクト (として Excel.Interfaces.CommentReplyCollectionData
型指定) を返します。
toJSON(): Excel.Interfaces.CommentReplyCollectionData;
戻り値
Office Add-ins
フィードバック
https://aka.ms/ContentUserFeedback」を参照してください。
以下は間もなく提供いたします。2024 年を通じて、コンテンツのフィードバック メカニズムとして GitHub の issue を段階的に廃止し、新しいフィードバック システムに置き換えます。 詳細については、「フィードバックの送信と表示