Skip to content

Commit 092b1b5

Browse files
[PowerPoint] (ShapeLineStyle) Update snippet to include reference (#1030)
1 parent 0c669a4 commit 092b1b5

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

samples/powerpoint/shapes/get-shapes-by-type.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ script:
2222
// Change the dash style for shapes of the type `line`.
2323
shapes.items.forEach((shape) => {
2424
if (shape.type === PowerPoint.ShapeType.line) {
25+
shape.lineFormat.style = PowerPoint.ShapeLineStyle.thickThin;
2526
shape.lineFormat.dashStyle = PowerPoint.ShapeLineDashStyle.dashDot;
2627
}
2728
});
43 Bytes
Binary file not shown.

snippet-extractor-output/snippets.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17679,6 +17679,7 @@ PowerPoint.ShapeLineDashStyle:enum:
1767917679
// Change the dash style for shapes of the type `line`.
1768017680
shapes.items.forEach((shape) => {
1768117681
if (shape.type === PowerPoint.ShapeType.line) {
17682+
shape.lineFormat.style = PowerPoint.ShapeLineStyle.thickThin;
1768217683
shape.lineFormat.dashStyle = PowerPoint.ShapeLineDashStyle.dashDot;
1768317684
}
1768417685
});
@@ -17701,6 +17702,7 @@ PowerPoint.ShapeLineFormat:class:
1770117702
// Change the dash style for shapes of the type `line`.
1770217703
shapes.items.forEach((shape) => {
1770317704
if (shape.type === PowerPoint.ShapeType.line) {
17705+
shape.lineFormat.style = PowerPoint.ShapeLineStyle.thickThin;
1770417706
shape.lineFormat.dashStyle = PowerPoint.ShapeLineDashStyle.dashDot;
1770517707
}
1770617708
});
@@ -17723,6 +17725,7 @@ PowerPoint.ShapeLineFormat#dashStyle:member:
1772317725
// Change the dash style for shapes of the type `line`.
1772417726
shapes.items.forEach((shape) => {
1772517727
if (shape.type === PowerPoint.ShapeType.line) {
17728+
shape.lineFormat.style = PowerPoint.ShapeLineStyle.thickThin;
1772617729
shape.lineFormat.dashStyle = PowerPoint.ShapeLineDashStyle.dashDot;
1772717730
}
1772817731
});
@@ -17790,6 +17793,7 @@ PowerPoint.ShapeType:enum:
1779017793
// Change the dash style for shapes of the type `line`.
1779117794
shapes.items.forEach((shape) => {
1779217795
if (shape.type === PowerPoint.ShapeType.line) {
17796+
shape.lineFormat.style = PowerPoint.ShapeLineStyle.thickThin;
1779317797
shape.lineFormat.dashStyle = PowerPoint.ShapeLineDashStyle.dashDot;
1779417798
}
1779517799
});
@@ -18155,6 +18159,29 @@ PowerPoint.SlideLayoutCollection#load:member(2):
1815518159
}
1815618160
}
1815718161
});
18162+
PowerPoint.ShapeLineStyle:enum:
18163+
- >-
18164+
// Link to full sample:
18165+
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/powerpoint/shapes/get-shapes-by-type.yaml
18166+
18167+
18168+
// Changes the dash style of every line in the slide.
18169+
18170+
await PowerPoint.run(async (context) => {
18171+
// Get the type of shape for every shape in the collection.
18172+
const shapes: PowerPoint.ShapeCollection = context.presentation.slides.getItemAt(0).shapes;
18173+
shapes.load("type");
18174+
await context.sync();
18175+
18176+
// Change the dash style for shapes of the type `line`.
18177+
shapes.items.forEach((shape) => {
18178+
if (shape.type === PowerPoint.ShapeType.line) {
18179+
shape.lineFormat.style = PowerPoint.ShapeLineStyle.thickThin;
18180+
shape.lineFormat.dashStyle = PowerPoint.ShapeLineDashStyle.dashDot;
18181+
}
18182+
});
18183+
await context.sync();
18184+
});
1815818185
PowerPoint.SlideMaster:class:
1815918186
- >-
1816018187
// Link to full sample:

0 commit comments

Comments
 (0)