Convert PowerPoint to Word
Contents
[
Hide
]
If you plan to use textual content or information from a presentation (PPT or PPTX) in new ways, you may benefit from converting the presentation to Word (DOC or DOCX).
- When compared to Microsoft PowerPoint, the Microsoft Word app is more equipped with tools or functionalities for content.
- Besides the editing functions in Word, you may also benefit from enhanced collaboration, printing, and sharing features.
You may want to try out our Presentation to Word Online Converter to see what you could gain from working with textual content from slides.
Aspose.Slides and Aspose.Words
To convert a PowerPoint file (PPTX or PPT) to Word (DOCX or DOCX), you need both Aspose.Slides for Python via .NET and Aspose.Words for Python via .NET.
As a standalone API, Aspose.Slides for Python via .NET provides functions that allow you to extract texts from presentations.
Aspose.Words is an advanced document processing API that allows applications to generate, modify, convert, render, print files, and perform other tasks with documents without utilizing Microsoft Word.
Convert PowerPoint to Word in Python
- Add these namespaces to your program.py file:
import aspose.slides as slides
import aspose.words as words
- Use this code snippet to convert the PowerPoint to Word:
with slides.Presentation("sample.pptx") as presentation:
doc = words.Document()
builder = words.DocumentBuilder(doc)
for index in range(presentation.slides.length):
slide = presentation.slides[index]
file_name = "slide_{i}.png".format(i=index)
# generates a slide image
with slide.get_image(1, 1) as image:
image.save(file_name, slides.ImageFormat.PNG)
builder.insert_image(file_name)
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("output.docx")