Skip to content

Commit f757bd2

Browse files
ElizabethSamuel-MSFTgithub-actions
andauthored
Automatically generated docs (#2302)
Co-authored-by: github-actions <[email protected]>
1 parent 3e0eb01 commit f757bd2

23 files changed

+471
-96
lines changed

docs/docs-ref-autogen/office/office/office.control.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,27 @@ remarks: >-
1616
**Requirement set**: [RibbonAPI
1717
1.1](https://learn.microsoft.com/javascript/api/requirement-sets/common/ribbon-api-requirement-sets)
1818
19+
20+
#### Examples
21+
22+
23+
```TypeScript
24+
25+
// This snippet enables a control (a button) in a custom ribbon tab.
26+
27+
// Note that "MyButton", "OfficeAddinTab1", and "CustomGroup111" are defined
28+
in the manifest.
29+
30+
const enableButton = async () => {
31+
const button: Control = { id: "MyButton", enabled: true };
32+
const parentGroup: Group = { id: "CustomGroup111", controls: [button] };
33+
const parentTab: Tab = { id: "OfficeAddinTab1", groups: [parentGroup] };
34+
const ribbonUpdater: RibbonUpdaterData = { tabs: [parentTab] };
35+
Office.ribbon.requestUpdate(ribbonUpdater);
36+
}
37+
38+
```
39+
1940
isPreview: false
2041
isDeprecated: false
2142
type: interface

docs/docs-ref-autogen/office_release/office/office.control.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,27 @@ remarks: >-
1616
**Requirement set**: [RibbonAPI
1717
1.1](https://learn.microsoft.com/javascript/api/requirement-sets/common/ribbon-api-requirement-sets)
1818
19+
20+
#### Examples
21+
22+
23+
```TypeScript
24+
25+
// This snippet enables a control (a button) in a custom ribbon tab.
26+
27+
// Note that "MyButton", "OfficeAddinTab1", and "CustomGroup111" are defined
28+
in the manifest.
29+
30+
const enableButton = async () => {
31+
const button: Control = { id: "MyButton", enabled: true };
32+
const parentGroup: Group = { id: "CustomGroup111", controls: [button] };
33+
const parentTab: Tab = { id: "OfficeAddinTab1", groups: [parentGroup] };
34+
const ribbonUpdater: RibbonUpdaterData = { tabs: [parentTab] };
35+
Office.ribbon.requestUpdate(ribbonUpdater);
36+
}
37+
38+
```
39+
1940
isPreview: false
2041
isDeprecated: false
2142
type: interface

docs/docs-ref-autogen/powerpoint/powerpoint/powerpoint.borderproperties.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ remarks: >-
2424
await PowerPoint.run(async (context) => {
2525
const shapes = context.presentation.getSelectedSlides().getItemAt(0).shapes;
2626
27-
// Add a table, specifying border styles
27+
// Add a table, specifying border styles.
2828
shapes.addTable(3, 4, {
2929
values: [
3030
["A", "BB", "CCC", "DDDD"],
@@ -76,7 +76,7 @@ properties:
7676
await PowerPoint.run(async (context) => {
7777
const shapes = context.presentation.getSelectedSlides().getItemAt(0).shapes;
7878
79-
// Add a table, specifying border styles
79+
// Add a table, specifying border styles.
8080
shapes.addTable(3, 4, {
8181
values: [
8282
["A", "BB", "CCC", "DDDD"],
@@ -128,7 +128,7 @@ properties:
128128
await PowerPoint.run(async (context) => {
129129
const shapes = context.presentation.getSelectedSlides().getItemAt(0).shapes;
130130
131-
// Add a table, specifying border styles
131+
// Add a table, specifying border styles.
132132
shapes.addTable(3, 4, {
133133
values: [
134134
["A", "BB", "CCC", "DDDD"],
@@ -206,7 +206,7 @@ properties:
206206
await PowerPoint.run(async (context) => {
207207
const shapes = context.presentation.getSelectedSlides().getItemAt(0).shapes;
208208
209-
// Add a table, specifying border styles
209+
// Add a table, specifying border styles.
210210
shapes.addTable(3, 4, {
211211
values: [
212212
["A", "BB", "CCC", "DDDD"],

docs/docs-ref-autogen/powerpoint/powerpoint/powerpoint.fillproperties.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ remarks: >-
2424
await PowerPoint.run(async (context) => {
2525
const shapes = context.presentation.getSelectedSlides().getItemAt(0).shapes;
2626
27-
// Add a table, specifying font formatting and fill colors
27+
// Add a table, specifying font formatting and fill colors.
2828
shapes.addTable(3, 4, {
2929
values: [
3030
["A", "BB", "CCC", "DDDD"],
@@ -88,7 +88,7 @@ properties:
8888
await PowerPoint.run(async (context) => {
8989
const shapes = context.presentation.getSelectedSlides().getItemAt(0).shapes;
9090
91-
// Add a table, specifying font formatting and fill colors
91+
// Add a table, specifying font formatting and fill colors.
9292
shapes.addTable(3, 4, {
9393
values: [
9494
["A", "BB", "CCC", "DDDD"],

docs/docs-ref-autogen/powerpoint/powerpoint/powerpoint.fontproperties.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ remarks: >-
2424
await PowerPoint.run(async (context) => {
2525
const shapes = context.presentation.getSelectedSlides().getItemAt(0).shapes;
2626
27-
// Add a table, specifying font formatting and fill colors
27+
// Add a table, specifying font formatting and fill colors.
2828
shapes.addTable(3, 4, {
2929
values: [
3030
["A", "BB", "CCC", "DDDD"],
@@ -122,7 +122,7 @@ properties:
122122
await PowerPoint.run(async (context) => {
123123
const shapes = context.presentation.getSelectedSlides().getItemAt(0).shapes;
124124
125-
// Add a table, specifying font formatting and fill colors
125+
// Add a table, specifying font formatting and fill colors.
126126
shapes.addTable(3, 4, {
127127
values: [
128128
["A", "BB", "CCC", "DDDD"],
@@ -186,7 +186,7 @@ properties:
186186
await PowerPoint.run(async (context) => {
187187
const shapes = context.presentation.getSelectedSlides().getItemAt(0).shapes;
188188
189-
// Add a table, specifying font formatting and fill colors
189+
// Add a table, specifying font formatting and fill colors.
190190
shapes.addTable(3, 4, {
191191
values: [
192192
["A", "BB", "CCC", "DDDD"],
@@ -269,7 +269,7 @@ properties:
269269
await PowerPoint.run(async (context) => {
270270
const shapes = context.presentation.getSelectedSlides().getItemAt(0).shapes;
271271
272-
// Add a table, specifying font formatting and fill colors
272+
// Add a table, specifying font formatting and fill colors.
273273
shapes.addTable(3, 4, {
274274
values: [
275275
["A", "BB", "CCC", "DDDD"],
@@ -367,7 +367,7 @@ properties:
367367
await PowerPoint.run(async (context) => {
368368
const shapes = context.presentation.getSelectedSlides().getItemAt(0).shapes;
369369
370-
// Add a table, specifying font formatting and fill colors
370+
// Add a table, specifying font formatting and fill colors.
371371
shapes.addTable(3, 4, {
372372
values: [
373373
["A", "BB", "CCC", "DDDD"],
@@ -431,7 +431,7 @@ properties:
431431
await PowerPoint.run(async (context) => {
432432
const shapes = context.presentation.getSelectedSlides().getItemAt(0).shapes;
433433
434-
// Add a table, specifying font formatting and fill colors
434+
// Add a table, specifying font formatting and fill colors.
435435
shapes.addTable(3, 4, {
436436
values: [
437437
["A", "BB", "CCC", "DDDD"],
@@ -495,7 +495,7 @@ properties:
495495
await PowerPoint.run(async (context) => {
496496
const shapes = context.presentation.getSelectedSlides().getItemAt(0).shapes;
497497
498-
// Add a table, specifying font formatting and fill colors
498+
// Add a table, specifying font formatting and fill colors.
499499
shapes.addTable(3, 4, {
500500
values: [
501501
["A", "BB", "CCC", "DDDD"],

docs/docs-ref-autogen/powerpoint/powerpoint/powerpoint.tableaddoptions.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ properties:
6666
await PowerPoint.run(async (context) => {
6767
const shapes = context.presentation.getSelectedSlides().getItemAt(0).shapes;
6868
69-
// Add a table, specifying column widths and row heights
69+
// Add a table, specifying column widths and row heights.
7070
shapes.addTable(3, 4, {
7171
columns: [{ columnWidth: 100 }, { columnWidth: 200 }, { columnWidth: 100 }, { columnWidth: 200 }],
7272
rows: [{ rowHeight: 60 }, { rowHeight: 120 }, { rowHeight: 180 }]
@@ -222,7 +222,7 @@ properties:
222222
await PowerPoint.run(async (context) => {
223223
const shapes = context.presentation.getSelectedSlides().getItemAt(0).shapes;
224224
225-
// Add a table, specifying column widths and row heights
225+
// Add a table, specifying column widths and row heights.
226226
shapes.addTable(3, 4, {
227227
columns: [{ columnWidth: 100 }, { columnWidth: 200 }, { columnWidth: 100 }, { columnWidth: 200 }],
228228
rows: [{ rowHeight: 60 }, { rowHeight: 120 }, { rowHeight: 180 }]
@@ -271,7 +271,7 @@ properties:
271271
await PowerPoint.run(async (context) => {
272272
const shapes = context.presentation.getSelectedSlides().getItemAt(0).shapes;
273273
274-
// Add a table, specifying font formatting and fill colors
274+
// Add a table, specifying font formatting and fill colors.
275275
shapes.addTable(3, 4, {
276276
values: [
277277
["A", "BB", "CCC", "DDDD"],
@@ -438,7 +438,7 @@ properties:
438438
await PowerPoint.run(async (context) => {
439439
const shapes = context.presentation.getSelectedSlides().getItemAt(0).shapes;
440440
441-
// Add a table, specifying border styles
441+
// Add a table, specifying border styles.
442442
shapes.addTable(3, 4, {
443443
values: [
444444
["A", "BB", "CCC", "DDDD"],

docs/docs-ref-autogen/powerpoint/powerpoint/powerpoint.tablecellborders.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ remarks: >-
2424
await PowerPoint.run(async (context) => {
2525
const shapes = context.presentation.getSelectedSlides().getItemAt(0).shapes;
2626
27-
// Add a table, specifying border styles
27+
// Add a table, specifying border styles.
2828
shapes.addTable(3, 4, {
2929
values: [
3030
["A", "BB", "CCC", "DDDD"],
@@ -74,7 +74,7 @@ properties:
7474
await PowerPoint.run(async (context) => {
7575
const shapes = context.presentation.getSelectedSlides().getItemAt(0).shapes;
7676
77-
// Add a table, specifying border styles
77+
// Add a table, specifying border styles.
7878
shapes.addTable(3, 4, {
7979
values: [
8080
["A", "BB", "CCC", "DDDD"],
@@ -158,7 +158,7 @@ properties:
158158
await PowerPoint.run(async (context) => {
159159
const shapes = context.presentation.getSelectedSlides().getItemAt(0).shapes;
160160
161-
// Add a table, specifying border styles
161+
// Add a table, specifying border styles.
162162
shapes.addTable(3, 4, {
163163
values: [
164164
["A", "BB", "CCC", "DDDD"],
@@ -210,7 +210,7 @@ properties:
210210
await PowerPoint.run(async (context) => {
211211
const shapes = context.presentation.getSelectedSlides().getItemAt(0).shapes;
212212
213-
// Add a table, specifying border styles
213+
// Add a table, specifying border styles.
214214
shapes.addTable(3, 4, {
215215
values: [
216216
["A", "BB", "CCC", "DDDD"],
@@ -262,7 +262,7 @@ properties:
262262
await PowerPoint.run(async (context) => {
263263
const shapes = context.presentation.getSelectedSlides().getItemAt(0).shapes;
264264
265-
// Add a table, specifying border styles
265+
// Add a table, specifying border styles.
266266
shapes.addTable(3, 4, {
267267
values: [
268268
["A", "BB", "CCC", "DDDD"],

docs/docs-ref-autogen/powerpoint/powerpoint/powerpoint.tablecellproperties.yml

Lines changed: 60 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ remarks: >-
2424
await PowerPoint.run(async (context) => {
2525
const shapes = context.presentation.getSelectedSlides().getItemAt(0).shapes;
2626
27-
// Add a table, specifying font formatting and fill colors
27+
// Add a table, specifying font formatting and fill colors.
2828
shapes.addTable(3, 4, {
2929
values: [
3030
["A", "BB", "CCC", "DDDD"],
@@ -86,7 +86,7 @@ properties:
8686
await PowerPoint.run(async (context) => {
8787
const shapes = context.presentation.getSelectedSlides().getItemAt(0).shapes;
8888
89-
// Add a table, specifying border styles
89+
// Add a table, specifying border styles.
9090
shapes.addTable(3, 4, {
9191
values: [
9292
["A", "BB", "CCC", "DDDD"],
@@ -138,7 +138,7 @@ properties:
138138
await PowerPoint.run(async (context) => {
139139
const shapes = context.presentation.getSelectedSlides().getItemAt(0).shapes;
140140
141-
// Add a table, specifying font formatting and fill colors
141+
// Add a table, specifying font formatting and fill colors.
142142
shapes.addTable(3, 4, {
143143
values: [
144144
["A", "BB", "CCC", "DDDD"],
@@ -202,7 +202,7 @@ properties:
202202
await PowerPoint.run(async (context) => {
203203
const shapes = context.presentation.getSelectedSlides().getItemAt(0).shapes;
204204
205-
// Add a table, specifying font formatting and fill colors
205+
// Add a table, specifying font formatting and fill colors.
206206
shapes.addTable(3, 4, {
207207
values: [
208208
["A", "BB", "CCC", "DDDD"],
@@ -395,6 +395,62 @@ properties:
395395
1.8](/javascript/api/requirement-sets/powerpoint/powerpoint-api-requirement-sets)
396396
\]
397397
398+
399+
#### Examples
400+
401+
402+
```TypeScript
403+
404+
// Link to full sample:
405+
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/powerpoint/shapes/add-modify-tables.yaml
406+
407+
408+
// Specifies the text runs of the cells in a table.
409+
410+
await PowerPoint.run(async (context) => {
411+
const shapes = context.presentation.getSelectedSlides().getItemAt(0).shapes;
412+
413+
// Add a table, specifying text runs.
414+
shapes.addTable(3, 4, {
415+
specificCellProperties: [
416+
[
417+
{ text: "Title text", font: { bold: true } },
418+
{ text: "Title text", font: { bold: true } },
419+
{ text: "Title text", font: { bold: true } },
420+
{ text: "Title text", font: { bold: true } }
421+
],
422+
[
423+
{ text: "Bold text", font: { bold: true } },
424+
{
425+
textRuns: [
426+
{ text: "Text runs with " },
427+
{ text: "Underlined text", font: { underline: PowerPoint.ShapeFontUnderlineStyle.double } },
428+
{ text: " and plain text" }
429+
]
430+
},
431+
{ text: "Italicized text", font: { italic: true } },
432+
{ text: "Plain text" }
433+
],
434+
[
435+
{ text: "Bold text", font: { bold: true } },
436+
{ text: "Underlined text", font: { underline: PowerPoint.ShapeFontUnderlineStyle.dotted } },
437+
{
438+
font: { bold: true },
439+
textRuns: [
440+
{ text: "Text runs with " },
441+
{ text: "italicized text", font: { italic: true } },
442+
{ text: " and (inherited) bold text" }
443+
]
444+
},
445+
{ text: "Italicized text", font: { italic: true } }
446+
]
447+
]
448+
});
449+
await context.sync();
450+
});
451+
452+
```
453+
398454
isPreview: false
399455
isDeprecated: false
400456
syntax:

docs/docs-ref-autogen/powerpoint/powerpoint/powerpoint.tablecolumnproperties.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ remarks: >-
2424
await PowerPoint.run(async (context) => {
2525
const shapes = context.presentation.getSelectedSlides().getItemAt(0).shapes;
2626
27-
// Add a table, specifying column widths and row heights
27+
// Add a table, specifying column widths and row heights.
2828
shapes.addTable(3, 4, {
2929
columns: [{ columnWidth: 100 }, { columnWidth: 200 }, { columnWidth: 100 }, { columnWidth: 200 }],
3030
rows: [{ rowHeight: 60 }, { rowHeight: 120 }, { rowHeight: 180 }]
@@ -70,7 +70,7 @@ properties:
7070
await PowerPoint.run(async (context) => {
7171
const shapes = context.presentation.getSelectedSlides().getItemAt(0).shapes;
7272
73-
// Add a table, specifying column widths and row heights
73+
// Add a table, specifying column widths and row heights.
7474
shapes.addTable(3, 4, {
7575
columns: [{ columnWidth: 100 }, { columnWidth: 200 }, { columnWidth: 100 }, { columnWidth: 200 }],
7676
rows: [{ rowHeight: 60 }, { rowHeight: 120 }, { rowHeight: 180 }]

docs/docs-ref-autogen/powerpoint/powerpoint/powerpoint.tablerowproperties.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ remarks: >-
2424
await PowerPoint.run(async (context) => {
2525
const shapes = context.presentation.getSelectedSlides().getItemAt(0).shapes;
2626
27-
// Add a table, specifying column widths and row heights
27+
// Add a table, specifying column widths and row heights.
2828
shapes.addTable(3, 4, {
2929
columns: [{ columnWidth: 100 }, { columnWidth: 200 }, { columnWidth: 100 }, { columnWidth: 200 }],
3030
rows: [{ rowHeight: 60 }, { rowHeight: 120 }, { rowHeight: 180 }]
@@ -70,7 +70,7 @@ properties:
7070
await PowerPoint.run(async (context) => {
7171
const shapes = context.presentation.getSelectedSlides().getItemAt(0).shapes;
7272
73-
// Add a table, specifying column widths and row heights
73+
// Add a table, specifying column widths and row heights.
7474
shapes.addTable(3, 4, {
7575
columns: [{ columnWidth: 100 }, { columnWidth: 200 }, { columnWidth: 100 }, { columnWidth: 200 }],
7676
rows: [{ rowHeight: 60 }, { rowHeight: 120 }, { rowHeight: 180 }]

0 commit comments

Comments
 (0)