From 93a9a9842ca4e4fc736eda84a3e7565c6f5f14be Mon Sep 17 00:00:00 2001 From: Viswajith-SF4658 Date: Tue, 11 Aug 2026 18:57:52 +0530 Subject: [PATCH] Updated Github examples for split sections to powerpoint presentation --- .../Split-PowerPoint-by-sections/Program.cs | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/Sections/Split-PowerPoint-by-Sections/.NET/Split-PowerPoint-by-sections/Program.cs b/Sections/Split-PowerPoint-by-Sections/.NET/Split-PowerPoint-by-sections/Program.cs index 256c7875..267190db 100644 --- a/Sections/Split-PowerPoint-by-Sections/.NET/Split-PowerPoint-by-sections/Program.cs +++ b/Sections/Split-PowerPoint-by-Sections/.NET/Split-PowerPoint-by-sections/Program.cs @@ -1,22 +1,22 @@ using Syncfusion.Presentation; - + //Opens the source PPTX document. -IPresentation sourcePptx = Presentation.Open(Path.GetFullPath(@"Data/Template.pptx")); +IPresentation sourcePptx = Presentation.Open(Path.GetFullPath(@"Data/Template.pptx")); //Iterates through each section. -foreach (ISection section in sourcePptx.Sections) +foreach (ISection section in sourcePptx.Sections) { -  //Creates a destination PPTX document. Existing presentations can also be used here. -  IPresentation destinationPptx = Presentation.Create(); -  // Clone the slides from the section and move to new PPTX document. -  foreach (ISlide slide in section.Slides) -  { -  destinationPptx.Slides.Add(slide.Clone(), PasteOptions.SourceFormatting, sourcePptx); -  } -  //Saves the destination PPTX document. -  string outputPath = Path.Combine(Path.GetFullPath("Output"), section.Name + "_Slides.pptx"); - destinationPptx.Save(outputPath); - destinationPptx.Close(); -} + //Creates a destination PPTX document. Existing presentations can also be used here. + IPresentation destinationPptx = Presentation.Create(); + // Clone the slides from the section and move to new PPTX document. + foreach (ISlide slide in section.Slides) + { + destinationPptx.Slides.Add(slide.Clone(), PasteOptions.SourceFormatting, sourcePptx); + } + //Saves the destination PPTX document. + string outputPath = Path.Combine(Path.GetFullPath("Output"), section.Name + "_Slides.pptx"); + destinationPptx.Save(outputPath); + destinationPptx.Close(); +} //Closes the PPTX document. -sourcePptx.Close(); \ No newline at end of file +sourcePptx.Close(); \ No newline at end of file