Word.ContentControlAddedEventArgs interface
Предоставляет сведения об элементе управления содержимым, который вызвал contentControlAdded событие.
Замечания
Примеры
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/10-content-controls/content-control-onadded-event.yaml
// Registers the onAdded event handler on the document.
await Word.run(async (context) => {
eventContext = context.document.onContentControlAdded.add(contentControlAdded);
await context.sync();
console.log("Added event handler for when content controls are added.");
});
...
async function contentControlAdded(event: Word.ContentControlAddedEventArgs) {
await Word.run(async (context) => {
console.log(`${event.eventType} event detected. IDs of content controls that were added:`, event.ids);
});
}
Свойства
| event |
Указывает тип события. Дополнительные сведения см. в этой |
| ids | Возвращает идентификаторы элементов управления содержимым. |
| source | Указывает источник события. Он может быть локальным или удаленным (с помощью совместного редактирования). |
Подробнее
eventType
Указывает тип события. Дополнительные сведения см. в этой Word.EventType статье.
eventType: 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"
Замечания
ids
Возвращает идентификаторы элементов управления содержимым.
ids: number[];
Стоимость недвижимости
number[]
Замечания
source
Указывает источник события. Он может быть локальным или удаленным (с помощью совместного редактирования).
source: Word.EventSource | "Local" | "Remote";
Стоимость недвижимости
Word.EventSource | "Local" | "Remote"