Edit

Share via


PowerPoint.ShapeFillType enum

Specifies a shape's fill type.

Remarks

[ API set: PowerPointApi 1.4 ]

Examples

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/powerpoint/shapes/get-set-shapes.yaml

// Changes the selected shapes fill color to red.
await PowerPoint.run(async (context) => {
  const shapes: PowerPoint.ShapeScopedCollection = context.presentation.getSelectedShapes();
  const shapeCount = shapes.getCount();
  shapes.load("items/fill/type");
  await context.sync();
  shapes.items.map((shape) => {
    const shapeFillType = shape.fill.type as PowerPoint.ShapeFillType;
    console.log(`Shape ID ${shape.id} original fill type: ${shapeFillType}`);
    shape.fill.setSolidColor("red");
  });
  await context.sync();
});

Fields

gradient = "Gradient"

Specifies that the shape should have gradient fill.

noFill = "NoFill"

Specifies that the shape should have no fill.

pattern = "Pattern"

Specifies that the shape should have pattern fill.

pictureAndTexture = "PictureAndTexture"

Specifies that the shape should have picture or texture fill.

slideBackground = "SlideBackground"

Specifies that the shape should have slide background fill.

solid = "Solid"

Specifies that the shape should have regular solid fill.