Convert POTX Files to POTM in Python

Save a PowerPoint Open XML template in the macro-enabled POTM format with Aspose.Slides for Python via Java.

Convert POTX to POTM in Python

Aspose.Slides for Python via Java can load a PowerPoint Open XML template (POTX) and save it in the macro-enabled template format (POTM). The conversion changes the file format but does not add VBA macros to the source content. Microsoft PowerPoint is not required.

Convert POTX to POTM using Python

Create a Presentation from the POTX file, then call save with SaveFormat.Potm.

Python code for converting POTX to POTM

presentation = Presentation("presentation.potx")
try:
    presentation.save("presentation.potm", SaveFormat.Potm)
finally:
    presentation.dispose()

How to convert POTX to POTM in Python

Follow these steps to save a POTX file as a macro-enabled POTM template.

  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 POTX file with Presentation.

  4. Call save with SaveFormat.Potm to create the POTM template.