Word.EventSource enum
イベントのソースを指定する列挙型。 ローカルまたはリモート (共同編集による) にすることができます。
注釈
使用元
- Word.CommentEventArgs: source
- Word.ContentControlAddedEventArgs: source
- Word.ContentControlDataChangedEventArgs: source
- Word.ContentControlDeletedEventArgs: source
- Word.ContentControlEnteredEventArgs: source
- Word.ContentControlExitedEventArgs: source
- Word.ContentControlSelectionChangedEventArgs: source
- Word.ParagraphAddedEventArgs: source
- Word.ParagraphChangedEventArgs: ソース
- Word.ParagraphDeletedEventArgs: source
例
// 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" | リモート ソース。 |