Word.ContentControlAddedEventArgs interface
Fornece informações sobre o controlo de conteúdo que levantou o evento ContentControlAdded.
Comentários
[ Conjunto de API: WordApi 1.5 ]
Exemplos
// 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);
});
}
Propriedades
event |
O tipo de evento. Veja Word. EventType para obter detalhes. |
ids | Obtém os IDs de controlo de conteúdo. |
source | A origem do evento. Pode ser local ou remoto (através da cocriação). |
Detalhes da propriedade
eventType
O tipo de evento. Veja Word. EventType para obter detalhes.
eventType: Word.EventType | "ContentControlDeleted" | "ContentControlSelectionChanged" | "ContentControlDataChanged" | "ContentControlAdded" | "CommentDeleted" | "CommentSelected" | "CommentDeselected" | "CommentChanged" | "CommentAdded" | "ContentControlEntered" | "ContentControlExited" | "ParagraphAdded" | "ParagraphChanged" | "ParagraphDeleted" | "AnnotationClicked" | "AnnotationHovered" | "AnnotationInserted" | "AnnotationRemoved" | "AnnotationPopupAction";
Valor da propriedade
Word.EventType | "ContentControlDeleted" | "ContentControlSelectionChanged" | "ContentControlDataChanged" | "ContentControlAdded" | "CommentDeleted" | "CommentSelected" | "CommentDeselected" | "CommentChanged" | "CommentAdded" | "ContentControlEntered" | "ContentControlExited" | "ParagraphAdded" | "ParagraphChanged" | "ParagraphDeleted" | "AnnotationClicked" | "AnnotationHovered" | "AnnotationInserted" | "AnnotationRemoved" | "AnnotationPopupAction"
Comentários
ids
Obtém os IDs de controlo de conteúdo.
ids: number[];
Valor da propriedade
number[]
Comentários
source
A origem do evento. Pode ser local ou remoto (através da cocriação).
source: Word.EventSource | "Local" | "Remote";
Valor da propriedade
Word.EventSource | "Local" | "Remote"