次の方法で共有


PowerPoint.SlideBackgroundSolidFillOptions interface

PowerPoint.SlideBackground 塗りつぶしを設定するために使用できるオプションを表します。

注釈

[ API set: 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

// Sets the background of the first selected slide to a solid orange fill at 20% transparency.
await PowerPoint.run(async (context) => {
  const slide: PowerPoint.Slide = context.presentation.getSelectedSlides().getItemAt(0);
  slide.background.fill.setSolidFill({
    color: "#FF8C00",
    transparency: 0.2,
  } as PowerPoint.SlideBackgroundSolidFillOptions);
  await context.sync();

  console.log("Background set to solid orange fill (20% transparent).");
});

プロパティ

color

指定した場合は、塗りつぶしの色を HTML の色形式 ("#FFA500" や "オレンジ" など) で指定します。

transparency

指定した場合は、塗りつぶしの透明度の割合を 0.0 (不透明) から 1.0 (クリア) までの値として指定します。

プロパティの詳細

color

指定した場合は、塗りつぶしの色を HTML の色形式 ("#FFA500" や "オレンジ" など) で指定します。

color?: string;

プロパティ値

string

注釈

[ API set: PowerPointApi 1.10 ]

transparency

指定した場合は、塗りつぶしの透明度の割合を 0.0 (不透明) から 1.0 (クリア) までの値として指定します。

transparency?: number;

プロパティ値

number

注釈

[ API set: PowerPointApi 1.10 ]