Edit

Share via


PowerPoint.SlideBackgroundFill class

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Represents the fill formatting of a slide background object.

Extends

Remarks

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

Properties

context

The request context associated with the object. This connects the add-in's process to the Office host application's process.

type

Returns the fill type of the slide background. See PowerPoint.SlideBackgroundFillType for details.

Methods

getGradientFillOrNullObject()

Gets the gradient fill properties. If the fill type is not gradient, an object with an isNullObject property set to true is returned. For further information, see *OrNullObject methods and properties.

getPatternFillOrNullObject()

Gets the pattern fill properties. If the fill type is not pattern, an object with an isNullObject property set to true is returned. For further information, see *OrNullObject methods and properties.

getPictureOrTextureFillOrNullObject()

Gets the picture or texture fill properties. If the fill type is not pictureOrTexture, an object with an isNullObject property set to true is returned. For further information, see *OrNullObject methods and properties.

getSolidFillOrNullObject()

Gets the solid fill properties. If the fill type is not solid, an object with an isNullObject property set to true is returned. For further information, see *OrNullObject methods and properties.

load(options)

Queues up a command to load the specified properties of the object. You must call context.sync() before reading the properties.

load(propertyNames)

Queues up a command to load the specified properties of the object. You must call context.sync() before reading the properties.

load(propertyNamesAndPaths)

Queues up a command to load the specified properties of the object. You must call context.sync() before reading the properties.

setGradientFill(options)

Sets the fill formatting of the slide background to a gradient fill. This changes the fill type to gradient.

setPatternFill(options)

Sets the fill formatting of the slide background to a pattern fill. This changes the fill type to pattern.

setPictureOrTextureFill(options)

Sets the fill formatting of the slide background to a picture or texture fill. This changes the fill type to pictureOrTexture.

setSolidFill(options)

Sets the fill formatting of the slide background to a solid fill. This changes the fill type to solid.

toJSON()

Overrides the JavaScript toJSON() method in order to provide more useful output when an API object is passed to JSON.stringify(). (JSON.stringify, in turn, calls the toJSON method of the object that's passed to it.) Whereas the original PowerPoint.SlideBackgroundFill object is an API object, the toJSON method returns a plain JavaScript object (typed as PowerPoint.Interfaces.SlideBackgroundFillData) that contains shallow copies of any loaded child properties from the original object.

Property Details

context

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

The request context associated with the object. This connects the add-in's process to the Office host application's process.

context: RequestContext;

Property Value

type

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Returns the fill type of the slide background. See PowerPoint.SlideBackgroundFillType for details.

readonly type: PowerPoint.SlideBackgroundFillType | "Unsupported" | "Solid" | "Gradient" | "PictureOrTexture" | "Pattern";

Property Value

PowerPoint.SlideBackgroundFillType | "Unsupported" | "Solid" | "Gradient" | "PictureOrTexture" | "Pattern"

Remarks

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

Method Details

getGradientFillOrNullObject()

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Gets the gradient fill properties. If the fill type is not gradient, an object with an isNullObject property set to true is returned. For further information, see *OrNullObject methods and properties.

getGradientFillOrNullObject(): PowerPoint.SlideBackgroundGradientFill;

Returns

Remarks

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

getPatternFillOrNullObject()

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Gets the pattern fill properties. If the fill type is not pattern, an object with an isNullObject property set to true is returned. For further information, see *OrNullObject methods and properties.

getPatternFillOrNullObject(): PowerPoint.SlideBackgroundPatternFill;

Returns

Remarks

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

getPictureOrTextureFillOrNullObject()

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Gets the picture or texture fill properties. If the fill type is not pictureOrTexture, an object with an isNullObject property set to true is returned. For further information, see *OrNullObject methods and properties.

getPictureOrTextureFillOrNullObject(): PowerPoint.SlideBackgroundPictureOrTextureFill;

Returns

Remarks

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

getSolidFillOrNullObject()

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Gets the solid fill properties. If the fill type is not solid, an object with an isNullObject property set to true is returned. For further information, see *OrNullObject methods and properties.

getSolidFillOrNullObject(): PowerPoint.SlideBackgroundSolidFill;

Returns

Remarks

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

load(options)

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Queues up a command to load the specified properties of the object. You must call context.sync() before reading the properties.

load(options?: PowerPoint.Interfaces.SlideBackgroundFillLoadOptions): PowerPoint.SlideBackgroundFill;

Parameters

options
PowerPoint.Interfaces.SlideBackgroundFillLoadOptions

Provides options for which properties of the object to load.

Returns

load(propertyNames)

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Queues up a command to load the specified properties of the object. You must call context.sync() before reading the properties.

load(propertyNames?: string | string[]): PowerPoint.SlideBackgroundFill;

Parameters

propertyNames

string | string[]

A comma-delimited string or an array of strings that specify the properties to load.

Returns

load(propertyNamesAndPaths)

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Queues up a command to load the specified properties of the object. You must call context.sync() before reading the properties.

load(propertyNamesAndPaths?: {
            select?: string;
            expand?: string;
        }): PowerPoint.SlideBackgroundFill;

Parameters

propertyNamesAndPaths

{ select?: string; expand?: string; }

propertyNamesAndPaths.select is a comma-delimited string that specifies the properties to load, and propertyNamesAndPaths.expand is a comma-delimited string that specifies the navigation properties to load.

Returns

setGradientFill(options)

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Sets the fill formatting of the slide background to a gradient fill. This changes the fill type to gradient.

setGradientFill(options?: PowerPoint.SlideBackgroundGradientFillOptions): void;

Parameters

options
PowerPoint.SlideBackgroundGradientFillOptions

Options for the gradient fill.

Returns

void

Remarks

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

setPatternFill(options)

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Sets the fill formatting of the slide background to a pattern fill. This changes the fill type to pattern.

setPatternFill(options?: PowerPoint.SlideBackgroundPatternFillOptions): void;

Parameters

options
PowerPoint.SlideBackgroundPatternFillOptions

Options for the pattern fill.

Returns

void

Remarks

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

setPictureOrTextureFill(options)

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Sets the fill formatting of the slide background to a picture or texture fill. This changes the fill type to pictureOrTexture.

setPictureOrTextureFill(options?: PowerPoint.SlideBackgroundPictureOrTextureFillOptions): void;

Parameters

options
PowerPoint.SlideBackgroundPictureOrTextureFillOptions

Options for the picture or texture fill.

Returns

void

Remarks

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

setSolidFill(options)

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Sets the fill formatting of the slide background to a solid fill. This changes the fill type to solid.

setSolidFill(options?: PowerPoint.SlideBackgroundSolidFillOptions): void;

Parameters

options
PowerPoint.SlideBackgroundSolidFillOptions

Options for the solid fill.

Returns

void

Remarks

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

toJSON()

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Overrides the JavaScript toJSON() method in order to provide more useful output when an API object is passed to JSON.stringify(). (JSON.stringify, in turn, calls the toJSON method of the object that's passed to it.) Whereas the original PowerPoint.SlideBackgroundFill object is an API object, the toJSON method returns a plain JavaScript object (typed as PowerPoint.Interfaces.SlideBackgroundFillData) that contains shallow copies of any loaded child properties from the original object.

toJSON(): PowerPoint.Interfaces.SlideBackgroundFillData;

Returns