PowerPoint.ShapeType enum
Specifies the type of a shape.
Remarks
[ API set: PowerPointApi 1.4 ]
Examples
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/powerpoint/shapes/get-shapes-by-type.yaml
// Changes the dash style of every line in the slide.
await PowerPoint.run(async (context) => {
// Get the type of shape for every shape in the collection.
const shapes: PowerPoint.ShapeCollection = context.presentation.slides.getItemAt(0).shapes;
shapes.load("type");
await context.sync();
// Change the dash style for shapes of the type `line`.
shapes.items.forEach((shape) => {
if (shape.type === PowerPoint.ShapeType.line) {
shape.lineFormat.dashStyle = PowerPoint.ShapeLineDashStyle.dashDot;
}
});
await context.sync();
});
Fields
callout = "Callout" | The shape is a callout. |
chart = "Chart" | The shape is a chart. |
contentApp = "ContentApp" | The shape is a content Office Add-in. |
diagram = "Diagram" | The shape is a diagram. |
freeform = "Freeform" | The shape is a freeform object. |
geometricShape = "GeometricShape" | The shape is a geometric shape such as rectangle. |
graphic = "Graphic" | The shape is a graphic. |
group = "Group" | The shape is a group shape which contains sub-shapes. |
image = "Image" | The shape is an image. |
ink = "Ink" | The shape is an ink object. |
line = "Line" | The shape is a line. |
media = "Media" | The shape is a media object. |
model3D = "Model3D" | The shape is a 3D model. |
ole = "Ole" | The shape is an OLE (Object Linking and Embedding) object. |
placeholder = "Placeholder" | The shape is a placeholder. |
smartArt = "SmartArt" | The shape is a SmartArt graphic. |
table = "Table" | The shape is a table. |
textBox = "TextBox" | The shape is a text box. |
unsupported = "Unsupported" | The given shape's type is unsupported. |
Office Add-ins