-
Notifications
You must be signed in to change notification settings - Fork 66
/
excel.conditionaltextcomparisonrule.yml
61 lines (52 loc) · 2.2 KB
/
excel.conditionaltextcomparisonrule.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
### YamlMime:TSType
name: Excel.ConditionalTextComparisonRule
uid: 'excel!Excel.ConditionalTextComparisonRule:interface'
package: excel!
fullName: Excel.ConditionalTextComparisonRule
summary: Represents a cell value conditional format rule.
remarks: '\[ [API set: ExcelApi 1.6](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
type: interface
properties:
- name: operator
uid: 'excel!Excel.ConditionalTextComparisonRule#operator:member'
package: excel!
fullName: operator
summary: The operator of the text conditional format.
remarks: '\[ [API set: ExcelApi 1.6](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'operator: Excel.ConditionalTextOperator | "Invalid" | "Contains" | "NotContains" | "BeginsWith" | "EndsWith";'
return:
type: >-
<xref uid="excel!Excel.ConditionalTextOperator:enum" /> | "Invalid" | "Contains" | "NotContains" |
"BeginsWith" | "EndsWith"
- name: text
uid: 'excel!Excel.ConditionalTextComparisonRule#text:member'
package: excel!
fullName: text
summary: The text value of the conditional format.
remarks: >-
\[ [API set: ExcelApi 1.6](/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/14-conditional-formatting/conditional-formatting-basic.yaml
await Excel.run(async (context) => {
const sheet = context.workbook.worksheets.getItem("Sample");
const range = sheet.getRange("B16:D18");
const conditionalFormat = range.conditionalFormats
.add(Excel.ConditionalFormatType.containsText);
conditionalFormat.textComparison.format.font.color = "red";
conditionalFormat.textComparison.rule = { operator: Excel.ConditionalTextOperator.contains, text: "Delayed" };
await context.sync();
});
```
isPreview: false
isDeprecated: false
syntax:
content: 'text: string;'
return:
type: string