Excel.CommentRichContent interface
Stellt den Inhalt dar, der in einem Kommentar oder einer Kommentarantwort enthalten ist. Rich-Content umfasst die Textzeichenfolge sowie alle anderen Objekte, die im Kommentartext enthalten sind, z. B. Erwähnungen.
Hinweise
Verwendet von
Eigenschaften
| mentions | Ein Array, das alle im Kommentar erwähnten Entitäten (z. B. Personen) enthält. |
| rich |
Gibt den umfangreichen Inhalt des Kommentars an (z. B. Kommentarinhalt mit Erwähnungen, die erste erwähnte Entität hat ein ID-Attribut von 0 und die zweite erwähnte Entität hat ein ID-Attribut von 1). |
Details zur Eigenschaft
mentions
Ein Array, das alle im Kommentar erwähnten Entitäten (z. B. Personen) enthält.
mentions?: Excel.CommentMention[];
Eigenschaftswert
Hinweise
Beispiele
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/12-comments-and-notes/comment-mentions.yaml
await Excel.run(async (context) => {
const sheet = context.workbook.worksheets.getItem("Comments");
const mention = {
email: "kakri@contoso.com",
id: 0,
name: "Kate Kristensen"
};
// This will tag the mention's name using the '@' syntax.
// They will be notified via email.
const commentBody = {
mentions: [mention],
richContent: '<at id="0">' + mention.name + "</at> - Can you take a look?"
};
// Note that an InvalidArgument error will be thrown if multiple cells passed to `comment.add`.
sheet.comments.add("A1", commentBody, Excel.ContentType.mention);
await context.sync();
});
richContent
Gibt den umfangreichen Inhalt des Kommentars an (z. B. Kommentarinhalt mit Erwähnungen, die erste erwähnte Entität hat ein ID-Attribut von 0 und die zweite erwähnte Entität hat ein ID-Attribut von 1).
richContent: string;
Eigenschaftswert
string