Word.CommentEventArgs interface
注意
此 API 以预览状态提供给开发者,可能根据我们收到的反馈更改。 请勿在生产环境中使用此 API。
提供有关引发注释事件的注释的信息。
注解
使用方
- Word.正文:onCommentAdded、onCommentChanged、onCommentDeleted、onCommentDeselected、onCommentSelected
- Word.ContentControl: onCommentAdded, onCommentChanged, onCommentDeselected, onCommentSelected
- Word.段落:onCommentAdded、onCommentChanged、onCommentDeleted、onCommentDeselected、onCommentSelected
- Word.范围:onCommentAdded、onCommentChanged、onCommentDeselected、onCommentSelected
示例
// 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 });
});
}
属性
| change |
表示 |
| comment |
获取 |
| source | 指定时间源。 它可以是本地的,也可以通过共同创作) 远程 (。 |
| type | 指定事件类型。 有关详细信息,请参阅 |
属性详细信息
changeType
注意
此 API 以预览状态提供给开发者,可能根据我们收到的反馈更改。 请勿在生产环境中使用此 API。
表示 commentChanged 如何引发事件。
changeType: Word.CommentChangeType | "none" | "edited" | "resolved" | "reopened" | "replyAdded" | "replyDeleted" | "replyEdited";
属性值
Word.CommentChangeType | "none" | "edited" | "resolved" | "reopened" | "replyAdded" | "replyDeleted" | "replyEdited"
注解
commentDetails
注意
此 API 以预览状态提供给开发者,可能根据我们收到的反馈更改。 请勿在生产环境中使用此 API。
获取 CommentDetail 包含相关注释的 ID 和回复 ID 的数组。
commentDetails: Word.CommentDetail[];
属性值
注解
source
注意
此 API 以预览状态提供给开发者,可能根据我们收到的反馈更改。 请勿在生产环境中使用此 API。
指定时间源。 它可以是本地的,也可以通过共同创作) 远程 (。
source: Word.EventSource | "Local" | "Remote";
属性值
Word.EventSource | "Local" | "Remote"
注解
type
注意
此 API 以预览状态提供给开发者,可能根据我们收到的反馈更改。 请勿在生产环境中使用此 API。
指定事件类型。 有关详细信息,请参阅 Word.EventType。
type: Word.EventType | "ContentControlDeleted" | "ContentControlSelectionChanged" | "ContentControlDataChanged" | "ContentControlAdded" | "AnnotationAdded" | "AnnotationChanged" | "AnnotationDeleted" | "CommentDeleted" | "CommentSelected" | "CommentDeselected" | "CommentChanged" | "CommentAdded" | "ContentControlEntered" | "ContentControlExited" | "ParagraphAdded" | "ParagraphChanged" | "ParagraphDeleted" | "AnnotationClicked" | "AnnotationHovered" | "AnnotationInserted" | "AnnotationRemoved" | "AnnotationPopupAction";
属性值
Word.EventType | "ContentControlDeleted" | "ContentControlSelectionChanged" | "ContentControlDataChanged" | "ContentControlAdded" | "AnnotationAdded" | "AnnotationChanged" | "AnnotationDeleted" | "CommentDeleted" | "CommentSelected" | "CommentDeselected" | "CommentChanged" | "CommentAdded" | "ContentControlEntered" | "ContentControlExited" | "ParagraphAdded" | "ParagraphChanged" | "ParagraphDeleted" | "AnnotationClicked" | "AnnotationHovered" | "AnnotationInserted" | "AnnotationRemoved" | "AnnotationPopupAction"