Merge PPTM files in Python

Combine macro-enabled PowerPoint presentations with Aspose.Slides for Python via .NET. Microsoft PowerPoint and OpenOffice are not required.

Merge PPTM in Python

Aspose.Slides for Python via .NET lets you merge PPTM presentations by cloning slides from a source Presentation into a destination Presentation. The cloned slides retain their layouts, shapes, styles, text, formatting, comments, and animations. Save the destination presentation with SaveFormat.PPTM to create a single macro-enabled PowerPoint file.

Merge PPTM files using Python

Clone each source slide with SlideCollection.add_clone, then call Presentation.save with SaveFormat.PPTM.

Python code to merge PPTM files into a single presentation

with slides.Presentation("presentation1.pptm") as destination_presentation:
    with slides.Presentation("presentation2.pptm") as source_presentation:
        for slide in source_presentation.slides:
            destination_presentation.slides.add_clone(slide)

    destination_presentation.save("merged_presentation.pptm", slides.export.SaveFormat.PPTM)

How to merge PPTM using Aspose.Slides for Python API

Follow these steps to merge two PPTM files and save the result as a single PPTM presentation in Python.

  1. Install Aspose.Slides for Python via .NET .

  2. Import the aspose.slides package.

  3. Open the destination and source PPTM files as Presentation instances.

  4. Clone each source slide by using SlideCollection.add_clone .

  5. Save the merged presentation with Presentation.save and SaveFormat.PPTM.