Convert PPT to Word in Python

Powerful cross-platform Python API for converting PowerPoint to Word using Python code without Microsoft PowerPoint or Office

Convert PowerPoint to Word using Aspose.Slides and Aspose.Words

Aspose.Slides for Python via .NET and Aspose.Words for Python via .NET are powerful Python libraries used to manipulate and convert PowerPoint presentations, Word documents, and other files. When you convert PowerPoint to Word, you are essentially moving the contents of a presentation’s slides to pages in a Word document.

Convert PowerPoint to Word in Python

You can convert PPT to Word quickly with just a few lines of code

Python code for converting PowerPoint to Word

presentation = slides.Presentation("pres.ppt")
doc = words.Document()
builder = words.DocumentBuilder(doc)

for index in range(presentation.slides.length):
    slide = presentation.slides[index]
    # generates and inserts slide image
    slide.get_thumbnail(2,2).save("slide_{i}.png".format(i = index), drawing.imaging.ImageFormat.png)
    builder.insert_image("slide_{i}.png".format(i = index))
    
    for shape in slide.shapes:
        # inserts slide's texts
        if (type(shape) is slides.AutoShape):
            builder.writeln(shape.text_frame.text)
   
    builder.insert_break(words.BreakType.PAGE_BREAK)
doc.save("presentation.docx")

How to convert PPT to Word

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

  2. Create an instance of the Presentation class and Doc class.

  3. Load the PPT presentation you want to convert to Word.

  4. Generate images and texts based on the slides’ contents.

  5. Save the resulting Word document.

Other Supported Conversions

You can also convert PowerPoint to files in other formats