Merge PPT and PPTX files

Hi,

I have a collection of ppt and pptx files. Is it possible to merge all of them into one ?
Currently if I use Presentation fullPresentation = new Presentation(); I am able to merge the files only if all are ppt and when I use PresentationEx fullPresentation = new PresentationEx(); I am able to merge the files only if all are pptx.

I dont care about the extension of the output file. It can either be a ppt or pptx. The main aim is to merge all the files.

I would really appreciate if you could help me out.
-
Aakash

Hi Aakash,

Thank you for considering Aspose.

To achieve your desired feature of merging PPT and PPTX files together, please download and try the new merged API of Aspose.Slides for .NET v13.12.0. This new merged API supports the inter conversion between PPT and PPTX files. Also, you may refer the following sample code to see how to achieve the merging both PPT and PPTX files together.

string[] files_list = new string[4];
files_list[0] = "C:\\data\\first.pptx";
files_list[1] = "C:\\data\\second.ppt";
files_list[2] = "C:\\data\\third.pptx";
files_list[3] = "C:\\data\\forth.ppt";

//Instantiate Presentation class for destination presentation (where slide is to be cloned)
Presentation destPres = new Presentation("C:\\data\\Main.pptx");

foreach (string file in files_list)
{
    //Instantiate Presentation class to load the source presentation file
    Presentation srcPres = new Presentation(file);

    //Get destination presentation's slides collection
    ISlideCollection slds = destPres.Slides;
    foreach (ISlide slide in srcPres.Slides)
    {
        //Clone the desired slide from the source presentation to the specified position in destination presentation
        slds.InsertClone(slds.Count, slide);
    }
}

//Write the destination presentation to disk
destPres.Save("c:\\data\\merged.pptx", SaveFormat.Pptx);

You can also refer to the documentation topic regarding Cloning of Slides in a Presentation for more details.

In case you need any further assistance, please feel free to contact support.

Thanks & Regards,