-
Notifications
You must be signed in to change notification settings - Fork 61
/
excel.clearapplyto.yml
86 lines (67 loc) · 2.64 KB
/
excel.clearapplyto.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
### YamlMime:TSEnum
name: Excel.ClearApplyTo
uid: 'excel!Excel.ClearApplyTo:enum'
package: excel!
fullName: Excel.ClearApplyTo
summary: ''
remarks: >-
\[ [API set: ExcelApi 1.1](/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/range-hyperlink.yaml
await Excel.run(async (context) => {
const sheet = context.workbook.worksheets.getItem("Orders");
const productsRange = sheet.getRange("A3:A11");
productsRange.load("values");
await context.sync();
// Clear all hyperlinks.
for (let i = 0; i < productsRange.values.length; i++) {
let cellRange = productsRange.getCell(i, 0);
// Clear the hyperlink.
// This removes the hyperlink but does not update text format.
cellRange.clear(Excel.ClearApplyTo.hyperlinks);
// Update text format.
cellRange.format.font.underline = Excel.RangeUnderlineStyle.none;
cellRange.format.font.color = "#000000";
}
await context.sync();
});
```
isPreview: false
isDeprecated: false
fields:
- name: all
uid: 'excel!Excel.ClearApplyTo.all:member'
package: excel!
summary: '* \[ [API set: ExcelApi 1.1](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
value: '"All"'
- name: contents
uid: 'excel!Excel.ClearApplyTo.contents:member'
package: excel!
summary: |-
Clears the contents of the range.
* \[ [API set: ExcelApi 1.1](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]
value: '"Contents"'
- name: formats
uid: 'excel!Excel.ClearApplyTo.formats:member'
package: excel!
summary: |-
Clears all formatting for the range.
* \[ [API set: ExcelApi 1.1](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]
value: '"Formats"'
- name: hyperlinks
uid: 'excel!Excel.ClearApplyTo.hyperlinks:member'
package: excel!
summary: |-
Clears all hyperlinks, but leaves all content and formatting intact.
* \[ [API set: ExcelApi 1.7](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]
value: '"Hyperlinks"'
- name: removeHyperlinks
uid: 'excel!Excel.ClearApplyTo.removeHyperlinks:member'
package: excel!
summary: >-
Removes hyperlinks and formatting for the cell but leaves content, conditional formats, and data validation
intact.
* \[ [API set: ExcelApi 1.7](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]
value: '"RemoveHyperlinks"'