Word.EventSource enum

指定事件源的枚举。 它可以是本地的,也可以通过共同创作) 远程 (。

注解

API 集:WordApi 1.5

使用方

示例

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/99-preview-apis/comment-events.yaml

async function onEventHandler(event: Word.CommentEventArgs) {
    // Report the event source and the IDs of affected comments and replies.
    const remoteSource: Word.EventSource = Word.EventSource.remote;
    console.log(`${event.type} event. Source: ${event.source}.`);
    if (event.source === remoteSource) {
        console.log("A coauthor triggered this event.");
    }
    event.commentDetails.forEach((comment: Word.CommentDetail) => {
        console.log("Affected comment:", { id: comment.id, replyIds: comment.replyIds });
    });
}

字段

local = "Local"

本地源。

remote = "Remote"

远程源。