Word.ContentControlEventArgs interface

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Provides information about the content control that raised an event.

Remarks

[ API set: WordApi BETA (PREVIEW ONLY) ]

Properties

contentControl

The object that raised the event. Load this object to get its properties.

eventType

The event type. See Word.EventType for details.

ids

Gets the content control IDs.

source

The source of the event. It can be local or remote (through coauthoring).

Property Details

contentControl

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

The object that raised the event. Load this object to get its properties.

contentControl: Word.ContentControl;

Property Value

Remarks

[ API set: WordApi BETA (PREVIEW ONLY) ]

Examples

// 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

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

The event type. See Word.EventType for details.

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

Property Value

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

Remarks

[ API set: WordApi BETA (PREVIEW ONLY) ]

Examples

// 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

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Gets the content control IDs.

ids: number[];

Property Value

number[]

Remarks

[ API set: WordApiOnline BETA (PREVIEW ONLY) ]

source

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

The source of the event. It can be local or remote (through coauthoring).

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

Property Value

Word.EventSource | "Local" | "Remote"

Remarks

[ API set: WordApiOnline BETA (PREVIEW ONLY) ]