通过


PowerPoint.SlideBackgroundFillType enum

指定 PowerPoint.SlideBackground 的填充类型。

注解

[ API 集:PowerPointApi 1.10 ]

示例

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

// Gets the background fill type of the first selected slide.
await PowerPoint.run(async (context) => {
  const slide: PowerPoint.Slide = context.presentation.getSelectedSlides().getItemAt(0);
  const fill: PowerPoint.SlideBackgroundFill = slide.background.fill;
  fill.load("type");
  await context.sync();

  const fillType = fill.type as PowerPoint.SlideBackgroundFillType;
  console.log(`Background fill type: ${fillType}`);
});

字段

gradient = "Gradient"

指定幻灯片背景应具有渐变填充。

pattern = "Pattern"

指定幻灯片背景应具有图案填充。

pictureOrTexture = "PictureOrTexture"

指定幻灯片背景应具有图片或纹理填充。

solid = "Solid"

指定幻灯片背景应具有常规实心填充。

unsupported = "Unsupported"

不支持幻灯片背景填充。