-
Notifications
You must be signed in to change notification settings - Fork 63
/
excel.cellpropertiesfont.yml
221 lines (206 loc) · 7.87 KB
/
excel.cellpropertiesfont.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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
### YamlMime:TSType
name: Excel.CellPropertiesFont
uid: 'excel!Excel.CellPropertiesFont:interface'
package: excel!
fullName: Excel.CellPropertiesFont
summary: >-
Represents the `format.font` properties of `getCellProperties`<!-- -->, `getRowProperties`<!-- -->, and
`getColumnProperties`<!-- -->, or the `format.font` input parameter of `setCellProperties`<!-- -->,
`setRowProperties`<!-- -->, and `setColumnProperties`<!-- -->.
remarks: '\[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
type: interface
properties:
- name: bold
uid: 'excel!Excel.CellPropertiesFont#bold:member'
package: excel!
fullName: bold
summary: Represents the `format.font.bold` property.
remarks: '\[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'bold?: boolean;'
return:
type: boolean
- name: color
uid: 'excel!Excel.CellPropertiesFont#color:member'
package: excel!
fullName: color
summary: Represents the `format.font.color` property.
remarks: >-
\[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]
#### Examples
```TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/42-range/cell-properties.yaml
await Excel.run(async (context) => {
const sheet = context.workbook.worksheets.getActiveWorksheet();
// Creating the SettableCellProperties objects to use for the range.
// In your add-in, these should be created once, outside the function.
const topHeaderProps: Excel.SettableCellProperties = {
// The style property takes a string matching the name of an Excel style.
// Built-in style names are listed in the `BuiltInStyle` enum.
// Note that a style will overwrite any formatting,
// so do not use the format property with the style property.
style: "Heading1"
};
const headerProps: Excel.SettableCellProperties = {
// Any subproperties of format that are not set will not be changed when these cell properties are set.
format: {
fill: {
color: "Blue"
},
font: {
color: "White",
bold: true
}
}
};
const nonApplicableProps: Excel.SettableCellProperties = {
format: {
fill: {
pattern: Excel.FillPattern.gray25
},
font: {
color: "Gray",
italic: true
}
}
};
const matchupScoreProps: Excel.SettableCellProperties = {
format: {
borders: {
bottom: {
style: Excel.BorderLineStyle.continuous
},
left: {
style: Excel.BorderLineStyle.continuous
},
right: {
style: Excel.BorderLineStyle.continuous
},
top: {
style: Excel.BorderLineStyle.continuous
}
}
}
};
const range = sheet.getRange("A1:E5");
// You can use empty JSON objects to avoid changing a cell's properties.
range.setCellProperties([
[topHeaderProps, {}, {}, {}, {}],
[{}, {}, headerProps, headerProps, headerProps],
[{}, headerProps, nonApplicableProps, matchupScoreProps, matchupScoreProps],
[{}, headerProps, matchupScoreProps, nonApplicableProps, matchupScoreProps],
[{}, headerProps, matchupScoreProps, matchupScoreProps, nonApplicableProps]
]);
sheet.getUsedRange().format.autofitColumns();
await context.sync();
});
```
isPreview: false
isDeprecated: false
syntax:
content: 'color?: string;'
return:
type: string
- name: italic
uid: 'excel!Excel.CellPropertiesFont#italic:member'
package: excel!
fullName: italic
summary: Represents the `format.font.italic` property.
remarks: '\[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'italic?: boolean;'
return:
type: boolean
- name: name
uid: 'excel!Excel.CellPropertiesFont#name:member'
package: excel!
fullName: name
summary: Represents the `format.font.name` property.
remarks: '\[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'name?: string;'
return:
type: string
- name: size
uid: 'excel!Excel.CellPropertiesFont#size:member'
package: excel!
fullName: size
summary: Represents the `format.font.size` property.
remarks: '\[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'size?: number;'
return:
type: number
- name: strikethrough
uid: 'excel!Excel.CellPropertiesFont#strikethrough:member'
package: excel!
fullName: strikethrough
summary: Represents the `format.font.strikethrough` property.
remarks: '\[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'strikethrough?: boolean;'
return:
type: boolean
- name: subscript
uid: 'excel!Excel.CellPropertiesFont#subscript:member'
package: excel!
fullName: subscript
summary: Represents the `format.font.subscript` property.
remarks: '\[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'subscript?: boolean;'
return:
type: boolean
- name: superscript
uid: 'excel!Excel.CellPropertiesFont#superscript:member'
package: excel!
fullName: superscript
summary: Represents the `format.font.superscript` property.
remarks: '\[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'superscript?: boolean;'
return:
type: boolean
- name: tintAndShade
uid: 'excel!Excel.CellPropertiesFont#tintAndShade:member'
package: excel!
fullName: tintAndShade
summary: Represents the `format.font.tintAndShade` property.
remarks: '\[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'tintAndShade?: number;'
return:
type: number
- name: underline
uid: 'excel!Excel.CellPropertiesFont#underline:member'
package: excel!
fullName: underline
summary: Represents the `format.font.underline` property.
remarks: '\[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'underline?: Excel.RangeUnderlineStyle | "None" | "Single" | "Double" | "SingleAccountant" | "DoubleAccountant";'
return:
type: >-
<xref uid="excel!Excel.RangeUnderlineStyle:enum" /> | "None" | "Single" | "Double" | "SingleAccountant" |
"DoubleAccountant"