Skip to content

Instantly share code, notes, and snippets.

@GroupDocsGists
Last active July 8, 2025 11:07
Show Gist options
  • Save GroupDocsGists/f4e0ca62dc4c3b361b095d2f4e1c4722 to your computer and use it in GitHub Desktop.
Save GroupDocsGists/f4e0ca62dc4c3b361b095d2f4e1c4722 to your computer and use it in GitHub Desktop.
How to merge PowerPoint presentations in C#

Merge PowerPoint Presentations in C#

In this snippet, you’ll discover how to merge PowerPoint presentations, leveraging a concise .NET example to combine multiple PPTX files into a single file. This approach not only simplifies your workflow but also saves time when dealing with multiple presentations.

📦 Prerequisites

To proceed, ensure you have the following:

This example works for multiple file types, including PPTX.

🧩 What You’ll Learn

  • Merge multiple PPTX files into a single presentation.
  • Easily join presentations with minimal code.
  • Handle file saving automatically after merging.
  • Simplify presentation management in C# applications.
  • Leverage GroupDocs.Merger for high-quality file handling.

💻 Code Example

See the following example: MergePptx.cs

✅ How to Use in .NET

  1. Install the GroupDocs.Merger package via NuGet.
  2. Load your first PPTX file with the Merger class.
  3. Use the Join method to add additional PPTX files.
  4. Specify the output file path for the merged presentation.
  5. Call the Save method to output the final merged file.
  6. Make sure to check the output directory for your merged PPTX.

📎 Related Resources

📜 Conclusion

That’s it! Now you know how to merge PowerPoint presentations efficiently. By following these steps, you can streamline your presentation management and save valuable time. For more details, visit our documentation or grab a trial to explore more features of GroupDocs.Merger.

using System;
using System.IO;
namespace GroupDocs.Merger.Examples.CSharp.BasicUsage
{
/// <summary>
/// This example demonstrates how to merge multiple PPTX files into single file.
/// For more details about merging PowerPoint Open XML Presentation (.pptx) files please check this documentation article
/// https://docs.groupdocs.com/merger/net/merge/powerpoint/
/// </summary>
internal static class MergePptx
{
public static void Run()
{
Console.WriteLine("=======================================================================");
Console.WriteLine();
Console.WriteLine("Example Basic Usage: MergePptx");
Console.WriteLine();
string outputFolder = Constants.GetOutputDirectoryPath();
string outputFile = Path.Combine(outputFolder, "merged.pptx");
// Load the source PPTX file
using (var merger = new GroupDocs.Merger.Merger(Constants.SAMPLE_PPTX))
{
// Add another PPTX file to merge
merger.Join(Constants.SAMPLE_PPTX_2);
// Merge PPTX files and save result
merger.Save(outputFile);
}
Console.WriteLine("\nPPTX files merge completed successfully. \nCheck output in {0}", outputFolder);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment