Modifica

Condividi tramite


PowerPoint.SlideBackgroundPatternFillOptions interface

Represents the available options for setting a PowerPoint.SlideBackground pattern fill.

Remarks

[ API set: PowerPointApi 1.10 ]

Examples

// 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 diagonal cross pattern fill.
await PowerPoint.run(async (context) => {
  const slide: PowerPoint.Slide = context.presentation.getSelectedSlides().getItemAt(0);
  slide.background.fill.setPatternFill({
    foregroundColor: "#1F3864",
    backgroundColor: "#D6E4F7",
    pattern: PowerPoint.SlideBackgroundPatternFillType.diagonalCross,
  } as PowerPoint.SlideBackgroundPatternFillOptions);
  await context.sync();

  console.log("Background set to diagonal cross pattern fill.");
});

Properties

backgroundColor

If provided, specifies the background color in HTML color format (e.g., "#FFFFFF" or "white").

foregroundColor

If provided, specifies the foreground color in HTML color format (e.g., "#FFA500" or "orange").

pattern

If provided, specifies the pattern type.

Property Details

backgroundColor

If provided, specifies the background color in HTML color format (e.g., "#FFFFFF" or "white").

backgroundColor?: string;

Property Value

string

Remarks

[ API set: PowerPointApi 1.10 ]

foregroundColor

If provided, specifies the foreground color in HTML color format (e.g., "#FFA500" or "orange").

foregroundColor?: string;

Property Value

string

Remarks

[ API set: PowerPointApi 1.10 ]

pattern

If provided, specifies the pattern type.

pattern?: PowerPoint.SlideBackgroundPatternFillType | "Unsupported" | "Percent5" | "Percent10" | "Percent20" | "Percent25" | "Percent30" | "Percent40" | "Percent50" | "Percent60" | "Percent70" | "Percent75" | "Percent80" | "Percent90" | "Horizontal" | "Vertical" | "LightHorizontal" | "LightVertical" | "DarkHorizontal" | "DarkVertical" | "NarrowHorizontal" | "NarrowVertical" | "DashedHorizontal" | "DashedVertical" | "Cross" | "DownwardDiagonal" | "UpwardDiagonal" | "LightDownwardDiagonal" | "LightUpwardDiagonal" | "DarkDownwardDiagonal" | "DarkUpwardDiagonal" | "WideDownwardDiagonal" | "WideUpwardDiagonal" | "DashedDownwardDiagonal" | "DashedUpwardDiagonal" | "DiagonalCross" | "SmallCheckerBoard" | "LargeCheckerBoard" | "SmallGrid" | "LargeGrid" | "DottedGrid" | "SmallConfetti" | "LargeConfetti" | "HorizontalBrick" | "DiagonalBrick" | "SolidDiamond" | "OutlinedDiamond" | "DottedDiamond" | "Plaid" | "Sphere" | "Weave" | "Divot" | "Shingle" | "Wave" | "Trellis" | "ZigZag";

Property Value

PowerPoint.SlideBackgroundPatternFillType | "Unsupported" | "Percent5" | "Percent10" | "Percent20" | "Percent25" | "Percent30" | "Percent40" | "Percent50" | "Percent60" | "Percent70" | "Percent75" | "Percent80" | "Percent90" | "Horizontal" | "Vertical" | "LightHorizontal" | "LightVertical" | "DarkHorizontal" | "DarkVertical" | "NarrowHorizontal" | "NarrowVertical" | "DashedHorizontal" | "DashedVertical" | "Cross" | "DownwardDiagonal" | "UpwardDiagonal" | "LightDownwardDiagonal" | "LightUpwardDiagonal" | "DarkDownwardDiagonal" | "DarkUpwardDiagonal" | "WideDownwardDiagonal" | "WideUpwardDiagonal" | "DashedDownwardDiagonal" | "DashedUpwardDiagonal" | "DiagonalCross" | "SmallCheckerBoard" | "LargeCheckerBoard" | "SmallGrid" | "LargeGrid" | "DottedGrid" | "SmallConfetti" | "LargeConfetti" | "HorizontalBrick" | "DiagonalBrick" | "SolidDiamond" | "OutlinedDiamond" | "DottedDiamond" | "Plaid" | "Sphere" | "Weave" | "Divot" | "Shingle" | "Wave" | "Trellis" | "ZigZag"

Remarks

[ API set: PowerPointApi 1.10 ]