Skip to main content

CreateSlide

Creates a new slide.

Syntax

expression.CreateSlide();

expression - A variable that represents a Api class.

Parameters

This method doesn't have any parameters.

Returns

ApiSlide

Example

Create a new slide and add it to the presentation.

// How do I insert a slide with a custom background in a presentation?

// Apply a gradient fill background to a new slide in a presentation.

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