Skip to main content

AddSlide

Appends a new slide to the end of the presentation.

Syntax

expression.AddSlide(oSlide);

expression - A variable that represents a ApiPresentation class.

Parameters

NameRequired/OptionalData typeDefaultDescription
oSlideRequiredApiSlideThe slide created using the Api#CreateSlide method.

Returns

This method doesn't return any data.

Example

This example appends a new slide to the end of the presentation.

// How to add a new slide to the presentation.

// Create a slide and add it to the end of presentation.

const presentation = Api.GetPresentation();
const slide = Api.CreateSlide();
const gs1 = Api.CreateGradientStop(Api.CreateRGBColor(255, 213, 191), 0);
const gs2 = Api.CreateGradientStop(Api.CreateRGBColor(255, 111, 61), 100000);
const fill = Api.CreateRadialGradientFill([gs1, gs2]);
slide.SetBackground(fill);
presentation.AddSlide(slide);