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.
publicstaticCreateNew(){ PowerPoint powerPoint = new(string.Format("../../test-{0}.pptx", DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss")), null);
// Add Blank Slide To the Blank Presentation // Return Slide Object that can be used to do slide level operationSlide slide =powerPoint.AddSlide(PresentationConstants.SlideLayoutType.BLANK);powerPoint.AddSlide(PresentationConstants.SlideLayoutType.BLANK);Slide slide1 =powerPoint.GetSlideByIndex(1); // Move the Slide OrderpowerPoint.MoveSlideByIndex(1,0); // Remove Slide and its content from PresentationpowerPoint.RemoveSlideByIndex(0); // Save the Opened PresentationpowerPoint.Save();}