In some cases, you may need to convert a PowerPoint presentation to a Word document. To automate this process or batch conversion, this article shows how to convert PowerPoint PPTX/PPT to Word DOCX using C#.

  • Convert PPTX or PPT to DOCX in C#

To convert PowerPoint presentations to Word documents, we will use a combination of Aspose.Slides for Java, a presentation operation API that lets you create or modify PowerPoint presentations, and Aspose.Words for.net. The latter is a Word processing API for generating or processing Word documents.

>> You can download the latest version of Aspose.Slides for the test experience.

Convert PowerPoint PPTX or PPT to DOCX in C#

Here are the steps to turn a PowerPoint presentation into a Word document using C#.

  • First, add references to asposed.Words for.NET and asposed.Slides for.NET to your project.
  • After using Aspose. Slides TAB. The Presentation class loading PowerPoint presentations.
  • The presentation is then saved into a MemoryStream object.
  • Create an object of class Aspose.Words.Document and initialize it with a MemoryStream object.
  • Finally, using Aspose. Words. Document. Save (string, Aspose. Words. SaveFormat. Docx) method to Save the Document.

The following code example shows how to convert PPTX to DOCX using C#.

// Load the PowerPoint presentation using(Aspose.Slides.Presentation presentation = new Aspose.Slides.Presentation("pres.pptx")) { using (var stream = new MemoryStream()) { // Save presentation to memory stream presentation.Save(stream, SaveFormat.Html); stream.Flush(); stream.Seek(0, SeekOrigin.Begin); // Load the content of the presentation to a Word document var doc = new Aspose.Words.Document(stream); // Save the Word document doc.Save("pres.docx", Aspose.Words.SaveFormat.Docx); }}Copy the code

If you have any questions or requirements, please feel free to join the Aspose Technology Exchange Group (761297826), we are happy to provide you with inquiries and consultation.