通过


Excel.CommentDeletedEventArgs interface

提供有关引发批注删除事件的注释的信息。

注解

[ API 集:ExcelApi 1.12 ]

示例

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}`);
    });
}

属性

commentDetails

CommentDetail获取包含其相关答复的注释 ID 和 ID 的数组。

source

指定时间源。 有关详细信息,请参阅 Excel.EventSource

type

获取事件的类型。 有关详细信息,请参阅 Excel.EventType

worksheetId

获取发生事件的工作表的 ID。

属性详细信息

commentDetails

CommentDetail获取包含其相关答复的注释 ID 和 ID 的数组。

commentDetails: Excel.CommentDetail[];

属性值

注解

[ API 集:ExcelApi 1.12 ]

source

指定时间源。 有关详细信息,请参阅 Excel.EventSource

source: Excel.EventSource | "Local" | "Remote";

属性值

Excel.EventSource | "Local" | "Remote"

注解

[ API 集:ExcelApi 1.12 ]

type

获取事件的类型。 有关详细信息,请参阅 Excel.EventType

type: "CommentDeleted";

属性值

"CommentDeleted"

注解

[ API 集:ExcelApi 1.12 ]

worksheetId

获取发生事件的工作表的 ID。

worksheetId: string;

属性值

string

注解

[ API 集:ExcelApi 1.12 ]