SetBackground
Sets the background to the current slide master.
Syntax
expression.SetBackground(oApiFill);
expression
- A variable that represents a ApiMaster class.
Parameters
Name | Required/Optional | Data type | Default | Description |
---|---|---|---|---|
oApiFill | Required | ApiFill | The color or pattern used to fill the presentation slide master background. |
Returns
boolean
Example
This example sets the background to the current slide master.
- Code
- Result
// How to set a background of a slide master.
// Create a solid fill and apply it as a background for a slide master.
const presentation = Api.GetPresentation();
const slide = presentation.GetSlideByIndex(0);
slide.RemoveAllObjects();
const master = presentation.GetMaster(0);
master.ClearBackground();
const fill = Api.CreateSolidFill(Api.CreateRGBColor(255, 111, 61));
master.SetBackground(fill);