Get Started
Usage API
More information

GetSlideByIndex

GetSlideByIndex(nIndex) → { ApiSlide }

Returns a slide by its position in the presentation.

Parameters:

Name Type Description
nIndex number

The slide number (position) in the presentation.

Returns:

Type
ApiSlide

Example

Copy code
builder.CreateFile("pptx");
var oPresentation = Api.GetPresentation();
var oSlide = oPresentation.GetSlideByIndex(0);
oSlide.RemoveAllObjects();
var oFill = Api.CreateSolidFill(Api.CreateRGBColor(61, 74, 107));
var oStroke = Api.CreateStroke(0, Api.CreateNoFill());
var oShape = Api.CreateShape("flowChartMagneticTape", 300 * 36000, 130 * 36000, oFill, oStroke);
oShape.SetPosition(608400, 1267200);
oSlide.AddObject(oShape);
builder.SaveFile("pptx", "GetSlideByIndex.pptx");
builder.CloseFile();

Resulting document