Skip to content

This content is for v4.x (Alpha). Switch to the Stable version.

The Powerpoint class, a core component of the OpenXMLOffice.Presentation library, empowers developers to create, open, and manipulate PowerPoint (.pptx) files with ease. Whether generating new presentations or working with existing ones, this class provides a simple yet powerful interface for efficient content manipulation. Once modifications are complete, users can effortlessly save the updated presentation.

Create or open a pptx file from path

public static CreateNew(){
PowerPoint powerPoint = new();
powerPoint.SaveAs("test.pptx");
}
public static OpenExisting(){
PowerPoint powerPoint = new("test.pptx",true, null);
powerPoint.SaveAs("/NewPath/file.pptx");
}

Create or open a pptx object using a stream

public static CreateUsingStream(Stream stream){
PowerPoint powerPoint = new();
powerPoint.SaveAs(stream);
}

Sample using most of the exposed functions

public static CreateNew(){
PowerPoint powerPoint = new();
// Add Blank Slide To the Blank Presentation
// Return Slide Object that can be used to do slide level operation
Slide slide = powerPoint.AddSlide(PresentationConstants.SlideLayoutType.BLANK);
powerPoint.AddSlide(PresentationConstants.SlideLayoutType.BLANK);
Slide slide1 = powerPoint.GetSlideByIndex(1);
// Move the Slide Order
powerPoint.MoveSlideByIndex(1,0);
// Remove Slide and its content from Presentation
powerPoint.RemoveSlideByIndex(0);
// Save the Opened Presentation
powerPoint.SaveAs("test.pptx");
}
PropertyTypeDetails
settingsPresentationSettingsProvides Presentation setting options
slideMastersDictionary<string, PresentationSlideMaster>?Multi-slide master support is in pipeline
themeThemePalletColor template for overall presentation
PropertyTypeDetails
isMultiSlideMasterPartPresentationboolGet or Set Multi-slide master option
isMultiThemePresentationboolGet or Set Multi-theme option
  • Multi Slide Master Support
  • Each Slide Master Theme Support