Word.ParagraphDeletedEventArgs interface
提供有关引发 paragraphDeleted 事件的段落的信息。
注解
示例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/25-paragraph/ondeleted-event.yaml
// Registers the onParagraphDeleted event handler on the document.
await Word.run(async (context) => {
eventContext = context.document.onParagraphDeleted.add(paragraphDeleted);
await context.sync();
console.log("Added event handlers for when paragraphs are deleted.");
});
...
async function paragraphDeleted(event: Word.ParagraphDeletedEventArgs) {
await Word.run(async (context) => {
console.log(`${event.type} event detected. IDs of paragraphs that were deleted:`, event.uniqueLocalIds);
});
}
属性
source | 事件的源。 通过共同创作) ,它可以是本地或远程 (。 |
type | 事件类型。 请参阅Word。EventType 了解详细信息。 |
unique |
获取所涉及的段落的唯一 ID。 ID 采用标准 8-4-4-4-4-12 GUID 格式,没有大括号,并且因会话和共同创作而异。 |
属性详细信息
source
事件的源。 通过共同创作) ,它可以是本地或远程 (。
source: Word.EventSource | "Local" | "Remote";
属性值
Word.EventSource | "Local" | "Remote"
注解
type
事件类型。 请参阅Word。EventType 了解详细信息。
type: Word.EventType | "ContentControlDeleted" | "ContentControlSelectionChanged" | "ContentControlDataChanged" | "ContentControlAdded" | "CommentDeleted" | "CommentSelected" | "CommentDeselected" | "CommentChanged" | "CommentAdded" | "ContentControlEntered" | "ContentControlExited" | "ParagraphAdded" | "ParagraphChanged" | "ParagraphDeleted" | "AnnotationClicked" | "AnnotationHovered" | "AnnotationInserted" | "AnnotationRemoved" | "AnnotationPopupAction";
属性值
Word.EventType | "ContentControlDeleted" | "ContentControlSelectionChanged" | "ContentControlDataChanged" | "ContentControlAdded" | "CommentDeleted" | "CommentSelected" | "CommentDeselected" | "CommentChanged" | "CommentAdded" | "ContentControlEntered" | "ContentControlExited" | "ParagraphAdded" | "ParagraphChanged" | "ParagraphDeleted" | "AnnotationClicked" | "AnnotationHovered" | "AnnotationInserted" | "AnnotationRemoved" | "AnnotationPopupAction"
注解
uniqueLocalIds
获取所涉及的段落的唯一 ID。 ID 采用标准 8-4-4-4-4-12 GUID 格式,没有大括号,并且因会话和共同创作而异。
uniqueLocalIds: string[];
属性值
string[]