Word.ContentControlEventArgs interface

注意

此 API 以预览状态提供给开发者,可能根据我们收到的反馈更改。 请勿在生产环境中使用此 API。

提供有关引发事件的内容控件的信息。

注解

[ API 集:WordApi BETA (仅预览版) ]

属性

contentControl

引发事件的 对象。 加载此对象以获取其属性。

eventType

事件类型。 有关详细信息,请参阅 Word.EventType。

ids

获取内容控件 ID。

source

事件的源。 通过共同创作) ,它可以是本地或远程 (。

属性详细信息

contentControl

注意

此 API 以预览状态提供给开发者,可能根据我们收到的反馈更改。 请勿在生产环境中使用此 API。

引发事件的 对象。 加载此对象以获取其属性。

contentControl: Word.ContentControl;

属性值

注解

[ API 集:WordApi BETA (仅预览版) ]

示例

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/99-preview-apis/content-control-ondeleted-event.yaml
async function contentControlDeleted(event: Word.ContentControlEventArgs) {
  await Word.run(async (context) => {
    // Display the deleted content control's ID.
    console.log(`${event.eventType} event detected. ID of content control that was deleted: ${event.contentControl.id}`);
  });
}

eventType

注意

此 API 以预览状态提供给开发者,可能根据我们收到的反馈更改。 请勿在生产环境中使用此 API。

事件类型。 有关详细信息,请参阅 Word.EventType。

eventType: Word.EventType | "ContentControlDeleted" | "ContentControlSelectionChanged" | "ContentControlDataChanged" | "ContentControlAdded" | "CommentDeleted" | "CommentSelected" | "CommentDeselected" | "CommentChanged" | "CommentAdded" | "ContentControlEntered" | "ContentControlExited";

属性值

Word.EventType | "ContentControlDeleted" | "ContentControlSelectionChanged" | "ContentControlDataChanged" | "ContentControlAdded" | "CommentDeleted" | "CommentSelected" | "CommentDeselected" | "CommentChanged" | "CommentAdded" | "ContentControlEntered" | "ContentControlExited"

注解

[ API 集:WordApi BETA (仅预览版) ]

示例

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/99-preview-apis/content-control-ondeleted-event.yaml
async function contentControlDeleted(event: Word.ContentControlEventArgs) {
  await Word.run(async (context) => {
    // Display the deleted content control's ID.
    console.log(`${event.eventType} event detected. ID of content control that was deleted: ${event.contentControl.id}`);
  });
}

ids

注意

此 API 以预览状态提供给开发者,可能根据我们收到的反馈更改。 请勿在生产环境中使用此 API。

获取内容控件 ID。

ids: number[];

属性值

number[]

注解

[ API 集:WordApi BETA (仅预览版) ]

source

注意

此 API 以预览状态提供给开发者,可能根据我们收到的反馈更改。 请勿在生产环境中使用此 API。

事件的源。 通过共同创作) ,它可以是本地或远程 (。

source: Word.EventSource | "Local" | "Remote";

属性值

Word.EventSource | "Local" | "Remote"

注解

[ API 集:WordApi BETA (仅预览版) ]