|
14818 | 14818 | currentLeft = 0; |
14819 | 14819 | if (currentTop > slideHeight - 200) currentTop = 0; |
14820 | 14820 | }); |
| 14821 | +'PowerPoint.Shape#type:member': |
| 14822 | + - >- |
| 14823 | + // Link to full sample: |
| 14824 | + https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/powerpoint/shapes/get-shapes-by-type.yaml |
| 14825 | + |
| 14826 | + |
| 14827 | + // Changes the transparency of every geometric shape in the slide. |
| 14828 | + |
| 14829 | + await PowerPoint.run(async (context) => { |
| 14830 | + // Get the type of shape for every shape in the collection. |
| 14831 | + const shapes = context.presentation.slides.getItemAt(0).shapes; |
| 14832 | + shapes.load("type"); |
| 14833 | + await context.sync(); |
| 14834 | + |
| 14835 | + // Change the shape transparency to be halfway transparent. |
| 14836 | + shapes.items.forEach((shape) => { |
| 14837 | + if (shape.type === PowerPoint.ShapeType.geometricShape) { |
| 14838 | + shape.fill.transparency = 0.5; |
| 14839 | + } |
| 14840 | + }); |
| 14841 | + await context.sync(); |
| 14842 | + }); |
14821 | 14843 | 'PowerPoint.Shape#width:member': |
14822 | 14844 | - >- |
14823 | 14845 | // Link to full sample: |
|
14944 | 14966 |
|
14945 | 14967 | console.log("Added key " + JSON.stringify(myShapeTag.key) + " with value " + JSON.stringify(myShapeTag.value)); |
14946 | 14968 | }); |
| 14969 | +'PowerPoint.ShapeCollection#load:member(2)': |
| 14970 | + - >- |
| 14971 | + // Link to full sample: |
| 14972 | + https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/powerpoint/shapes/get-shapes-by-type.yaml |
| 14973 | + |
| 14974 | + |
| 14975 | + // Changes the transparency of every geometric shape in the slide. |
| 14976 | + |
| 14977 | + await PowerPoint.run(async (context) => { |
| 14978 | + // Get the type of shape for every shape in the collection. |
| 14979 | + const shapes = context.presentation.slides.getItemAt(0).shapes; |
| 14980 | + shapes.load("type"); |
| 14981 | + await context.sync(); |
| 14982 | + |
| 14983 | + // Change the shape transparency to be halfway transparent. |
| 14984 | + shapes.items.forEach((shape) => { |
| 14985 | + if (shape.type === PowerPoint.ShapeType.geometricShape) { |
| 14986 | + shape.fill.transparency = 0.5; |
| 14987 | + } |
| 14988 | + }); |
| 14989 | + await context.sync(); |
| 14990 | + }); |
14947 | 14991 | 'PowerPoint.ShapeFill#setSolidColor:member(1)': |
14948 | 14992 | - >- |
14949 | 14993 | // Link to full sample: |
|
14962 | 15006 | }); |
14963 | 15007 | await context.sync(); |
14964 | 15008 | }); |
| 15009 | +'PowerPoint.ShapeFill#transparency:member': |
| 15010 | + - >- |
| 15011 | + // Link to full sample: |
| 15012 | + https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/powerpoint/shapes/get-shapes-by-type.yaml |
| 15013 | + |
| 15014 | + |
| 15015 | + // Changes the transparency of every geometric shape in the slide. |
| 15016 | + |
| 15017 | + await PowerPoint.run(async (context) => { |
| 15018 | + // Get the type of shape for every shape in the collection. |
| 15019 | + const shapes = context.presentation.slides.getItemAt(0).shapes; |
| 15020 | + shapes.load("type"); |
| 15021 | + await context.sync(); |
| 15022 | + |
| 15023 | + // Change the shape transparency to be halfway transparent. |
| 15024 | + shapes.items.forEach((shape) => { |
| 15025 | + if (shape.type === PowerPoint.ShapeType.geometricShape) { |
| 15026 | + shape.fill.transparency = 0.5; |
| 15027 | + } |
| 15028 | + }); |
| 15029 | + await context.sync(); |
| 15030 | + }); |
14965 | 15031 | 'PowerPoint.ShapeFont#color:member': |
14966 | 15032 | - >- |
14967 | 15033 | // Link to full sample: |
|
14975 | 15041 | textRange.font.color = "green"; |
14976 | 15042 | await context.sync(); |
14977 | 15043 | }); |
| 15044 | +'PowerPoint.ShapeLineDashStyle:enum': |
| 15045 | + - >- |
| 15046 | + // Link to full sample: |
| 15047 | + https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/powerpoint/shapes/get-shapes-by-type.yaml |
| 15048 | + |
| 15049 | + |
| 15050 | + // Changes the dash style of every line in the slide. |
| 15051 | + |
| 15052 | + await PowerPoint.run(async (context) => { |
| 15053 | + // Get the type of shape for every shape in the collection. |
| 15054 | + const shapes = context.presentation.slides.getItemAt(0).shapes; |
| 15055 | + shapes.load("type"); |
| 15056 | + await context.sync(); |
| 15057 | + |
| 15058 | + // Change the dash style for shapes of the type `line`. |
| 15059 | + shapes.items.forEach((shape) => { |
| 15060 | + if (shape.type === PowerPoint.ShapeType.line) { |
| 15061 | + shape.lineFormat.dashStyle = PowerPoint.ShapeLineDashStyle.dashDot; |
| 15062 | + } |
| 15063 | + }); |
| 15064 | + await context.sync(); |
| 15065 | + }); |
| 15066 | +'PowerPoint.ShapeLineFormat#dashStyle:member': |
| 15067 | + - >- |
| 15068 | + // Link to full sample: |
| 15069 | + https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/powerpoint/shapes/get-shapes-by-type.yaml |
| 15070 | + |
| 15071 | + |
| 15072 | + // Changes the dash style of every line in the slide. |
| 15073 | + |
| 15074 | + await PowerPoint.run(async (context) => { |
| 15075 | + // Get the type of shape for every shape in the collection. |
| 15076 | + const shapes = context.presentation.slides.getItemAt(0).shapes; |
| 15077 | + shapes.load("type"); |
| 15078 | + await context.sync(); |
| 15079 | + |
| 15080 | + // Change the dash style for shapes of the type `line`. |
| 15081 | + shapes.items.forEach((shape) => { |
| 15082 | + if (shape.type === PowerPoint.ShapeType.line) { |
| 15083 | + shape.lineFormat.dashStyle = PowerPoint.ShapeLineDashStyle.dashDot; |
| 15084 | + } |
| 15085 | + }); |
| 15086 | + await context.sync(); |
| 15087 | + }); |
| 15088 | +'PowerPoint.ShapeType:enum': |
| 15089 | + - >- |
| 15090 | + // Link to full sample: |
| 15091 | + https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/powerpoint/shapes/get-shapes-by-type.yaml |
| 15092 | + |
| 15093 | + |
| 15094 | + // Changes the dash style of every line in the slide. |
| 15095 | + |
| 15096 | + await PowerPoint.run(async (context) => { |
| 15097 | + // Get the type of shape for every shape in the collection. |
| 15098 | + const shapes = context.presentation.slides.getItemAt(0).shapes; |
| 15099 | + shapes.load("type"); |
| 15100 | + await context.sync(); |
| 15101 | + |
| 15102 | + // Change the dash style for shapes of the type `line`. |
| 15103 | + shapes.items.forEach((shape) => { |
| 15104 | + if (shape.type === PowerPoint.ShapeType.line) { |
| 15105 | + shape.lineFormat.dashStyle = PowerPoint.ShapeLineDashStyle.dashDot; |
| 15106 | + } |
| 15107 | + }); |
| 15108 | + await context.sync(); |
| 15109 | + }); |
14978 | 15110 | 'PowerPoint.Slide#delete:member(1)': |
14979 | 15111 | - >- |
14980 | 15112 | // Link to full sample: |
|
0 commit comments