PowerPoint.ShapeType enum

指定形状的类型。

注解

[ API 集:PowerPointApi 1.4 ]

示例

// 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 = 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();
});

字段

geometricShape = "GeometricShape"

形状是几何形状,如矩形

group = "Group"

形状是包含子形状的组形状

image = "Image"

形状是图像

line = "Line"

形状是一条线

table = "Table"

形状是表格

unsupported = "Unsupported"

给定形状的类型不受支持。