-
Notifications
You must be signed in to change notification settings - Fork 63
/
word.critique.yml
123 lines (111 loc) · 3.9 KB
/
word.critique.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
### YamlMime:TSType
name: Word.Critique
uid: 'word!Word.Critique:interface'
package: word!
fullName: Word.Critique
summary: Critique that will be rendered as underline for the specified part of paragraph in the document.
remarks: >-
\[ [API set: WordApi 1.7](/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/50-document/manage-annotations.yaml
// Adds annotations to the selected paragraph.
await Word.run(async (context) => {
const paragraph: Word.Paragraph = context.document.getSelection().paragraphs.getFirst();
const options: Word.CritiquePopupOptions = {
brandingTextResourceId: "PG.TabLabel",
subtitleResourceId: "PG.HelpCommand.TipTitle",
titleResourceId: "PG.HelpCommand.Label",
suggestions: ["suggestion 1", "suggestion 2", "suggestion 3"]
};
const critique1: Word.Critique = {
colorScheme: Word.CritiqueColorScheme.red,
start: 1,
length: 3,
popupOptions: options
};
const critique2: Word.Critique = {
colorScheme: Word.CritiqueColorScheme.green,
start: 6,
length: 1,
popupOptions: options
};
const critique3: Word.Critique = {
colorScheme: Word.CritiqueColorScheme.blue,
start: 10,
length: 3,
popupOptions: options
};
const critique4: Word.Critique = {
colorScheme: Word.CritiqueColorScheme.lavender,
start: 14,
length: 3,
popupOptions: options
};
const critique5: Word.Critique = {
colorScheme: Word.CritiqueColorScheme.berry,
start: 18,
length: 10,
popupOptions: options
};
const annotationSet: Word.AnnotationSet = {
critiques: [critique1, critique2, critique3, critique4, critique5]
};
const annotationIds = paragraph.insertAnnotations(annotationSet);
await context.sync();
console.log("Annotations inserted:", annotationIds.value);
});
```
isPreview: false
isDeprecated: false
type: interface
properties:
- name: colorScheme
uid: 'word!Word.Critique#colorScheme:member'
package: word!
fullName: colorScheme
summary: Gets the color scheme of the critique.
remarks: '\[ [API set: WordApi 1.7](/javascript/api/requirement-sets/word/word-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'colorScheme: Word.CritiqueColorScheme | "Red" | "Green" | "Blue" | "Lavender" | "Berry";'
return:
type: '<xref uid="word!Word.CritiqueColorScheme:enum" /> | "Red" | "Green" | "Blue" | "Lavender" | "Berry"'
- name: length
uid: 'word!Word.Critique#length:member'
package: word!
fullName: length
summary: Gets the length of the critique inside paragraph.
remarks: '\[ [API set: WordApi 1.7](/javascript/api/requirement-sets/word/word-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'length: number;'
return:
type: number
- name: popupOptions
uid: 'word!Word.Critique#popupOptions:member'
package: word!
fullName: popupOptions
summary: Specifies the behavior of the pop-up menu for the critique.
remarks: '\[ [API set: WordApi 1.8](/javascript/api/requirement-sets/word/word-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'popupOptions: Word.CritiquePopupOptions;'
return:
type: '<xref uid="word!Word.CritiquePopupOptions:interface" />'
- name: start
uid: 'word!Word.Critique#start:member'
package: word!
fullName: start
summary: Gets the start index of the critique inside paragraph.
remarks: '\[ [API set: WordApi 1.7](/javascript/api/requirement-sets/word/word-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'start: number;'
return:
type: number