Convert PPTX to PPTM in Python

Save a PowerPoint presentation in the macro-enabled PPTM format with Aspose.Slides for Python via Java.

Convert PPTX to PPTM in Python

Aspose.Slides for Python via Java can load a macro-free PowerPoint presentation (PPTX) and save it as a macro-enabled Open XML presentation (PPTM). PPTM supports VBA projects, but selecting this output format does not add macros to a presentation that has none. Microsoft PowerPoint is not required.

Convert PPTX to PPTM using Python

Create a Presentation from the PPTX file, then call save with SaveFormat.Pptm.

Python code for converting PPTX to PPTM

presentation = Presentation("presentation.pptx")
try:
    presentation.save("presentation.pptm", SaveFormat.Pptm)
finally:
    presentation.dispose()

How to convert PPTX to PPTM in Python

Follow these steps to convert a PowerPoint presentation to the macro-enabled PPTM format.

  1. Install Aspose.Slides for Python via Java .

  2. Configure the package and start the Java Virtual Machine in your application.

  3. Open the source PPTX file with Presentation.

  4. Call save with SaveFormat.Pptm to create the PPTM presentation.