-
Notifications
You must be signed in to change notification settings - Fork 61
/
word.contentcontroladdedeventargs.yml
87 lines (73 loc) · 3.22 KB
/
word.contentcontroladdedeventargs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
### YamlMime:TSType
name: Word.ContentControlAddedEventArgs
uid: 'word!Word.ContentControlAddedEventArgs:interface'
package: word!
fullName: Word.ContentControlAddedEventArgs
summary: Provides information about the content control that raised contentControlAdded event.
remarks: >-
\[ [API set: WordApi 1.5](/javascript/api/requirement-sets/word/word-api-requirement-sets) \]
#### Examples
```TypeScript
// 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);
});
}
```
isPreview: false
isDeprecated: false
type: interface
properties:
- name: eventType
uid: 'word!Word.ContentControlAddedEventArgs#eventType:member'
package: word!
fullName: eventType
summary: The event type. See Word.EventType for details.
remarks: '\[ [API set: WordApi 1.5](/javascript/api/requirement-sets/word/word-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: >-
eventType: Word.EventType | "ContentControlDeleted" | "ContentControlSelectionChanged" |
"ContentControlDataChanged" | "ContentControlAdded" | "ContentControlEntered" | "ContentControlExited" |
"ParagraphAdded" | "ParagraphChanged" | "ParagraphDeleted" | "AnnotationClicked" | "AnnotationHovered" |
"AnnotationInserted" | "AnnotationRemoved";
return:
type: >-
<xref uid="word!Word.EventType:enum" /> | "ContentControlDeleted" | "ContentControlSelectionChanged" |
"ContentControlDataChanged" | "ContentControlAdded" | "ContentControlEntered" | "ContentControlExited" |
"ParagraphAdded" | "ParagraphChanged" | "ParagraphDeleted" | "AnnotationClicked" | "AnnotationHovered" |
"AnnotationInserted" | "AnnotationRemoved"
- name: ids
uid: 'word!Word.ContentControlAddedEventArgs#ids:member'
package: word!
fullName: ids
summary: Gets the content control IDs.
remarks: '\[ [API set: WordApi 1.5](/javascript/api/requirement-sets/word/word-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'ids: number[];'
return:
type: 'number[]'
- name: source
uid: 'word!Word.ContentControlAddedEventArgs#source:member'
package: word!
fullName: source
summary: The source of the event. It can be local or remote (through coauthoring).
remarks: '\[ [API set: WordApi 1.5](/javascript/api/requirement-sets/word/word-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'source: Word.EventSource | "Local" | "Remote";'
return:
type: '<xref uid="word!Word.EventSource:enum" /> | "Local" | "Remote"'