Word.EventType enum

提供有关引发事件的类型的信息。

注解

[ API 集:WordApi 1.5 ]

示例

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/10-content-controls/content-control-ondeleted-event.yaml

async function contentControlDeleted(event: Word.ContentControlDeletedEventArgs) {
  await Word.run(async (context) => {
    console.log(`${event.eventType} event detected. IDs of content controls that were deleted:`, event.ids);
  });
}

字段

contentControlAdded = "ContentControlAdded"

ContentControlAdded 表示内容控件已添加到文档的事件。

contentControlDataChanged = "ContentControlDataChanged"

ContentControlDataChanged 表示内容控件中的数据已更改的事件。

contentControlDeleted = "ContentControlDeleted"

ContentControlDeleted 表示已删除内容控件的事件。

contentControlEntered = "ContentControlEntered"

表示已输入内容控件。

contentControlExited = "ContentControlExited"

表示内容控件已退出。

contentControlSelectionChanged = "ContentControlSelectionChanged"

ContentControlSelectionChanged 表示内容控件中的选定内容已更改的事件。

paragraphAdded = "ParagraphAdded"

表示添加了一个或多个新段落。

paragraphChanged = "ParagraphChanged"

表示更改了一个或多个段落。

paragraphDeleted = "ParagraphDeleted"

表示已删除一个或多个段落。