Excel.CommentDeletedEventArgs interface
Provides information about the comments that raised the comment deleted event.
Remarks
Examples
async function registerEventHandlers() {
await Excel.run(async (context) => {
// Register the onDeleted comment event handler.
const comments = context.workbook.worksheets.getActiveWorksheet().comments;
comments.onDeleted.add(commentDeleted);
await context.sync();
});
}
async function commentDeleted(event: Excel.CommentDeletedEventArgs) {
// Print out the deleted comment's ID.
// Note: This function assumes only a single comment is deleted at a time.
await Excel.run(async (context) => {
console.log(`A comment was deleted:`);
console.log(` ID: ${event.commentDetails[0].commentId}`);
});
}
Properties
| comment |
Gets the |
| source | Specifies the source of the event. See |
| type | Gets the type of the event. See |
| worksheet |
Gets the ID of the worksheet in which the event happened. |
Property Details
commentDetails
Gets the CommentDetail array that contains the comment ID and IDs of its related replies.
commentDetails: Excel.CommentDetail[];
Property Value
Remarks
source
Specifies the source of the event. See Excel.EventSource for details.
source: Excel.EventSource | "Local" | "Remote";
Property Value
Excel.EventSource | "Local" | "Remote"
Remarks
type
Gets the type of the event. See Excel.EventType for details.
type: "CommentDeleted";
Property Value
"CommentDeleted"
Remarks
worksheetId
Gets the ID of the worksheet in which the event happened.
worksheetId: string;
Property Value
string