In certain cases, you may need to convert the PowerPoint presentations to Word documents. In order to automate this process or for batch conversion, this article covers how to convert PowerPoint PPTX/PPT to Word DOCX using C#.
APIs for PowerPoint to Word Conversion
In order to convert a PowerPoint presentation to Word document, we’ll use Aspose.Slides for .NET in combination with Aspose.Words for .NET. The former is a presentation manipulation API that lets you create or modify PowerPoint presentations. Whereas, the latter is a word processing API for generating or processing Word documents. You can either download the APIs or install them using NuGet. In addition, you can get a complete package of Aspose APIs as Aspose.Total for .NET.
PM> Install-Package Aspose.Slides.NET PM> Install-Package Aspose.Words
Convert PowerPoint PPTX or PPT to DOCX in C#
The following are the steps to convert a PowerPoint presentation to Word document using C#.
- First, add references of Aspose.Words for .NET and Aspose.Slides for .NET into your project.
- After that, load the PowerPoint presentation using Aspose.Slides.Presentation class.
- Then, save the presentation into a MemoryStream object.
- Create an object of Aspose.Words.Document class and initialize it with MemoryStream object.
- Finally, save the document using Aspose.Words.Document.Save(string, Aspose.Words.SaveFormat.Docx) method.
The following code sample shows how to convert a PPTX to DOCX using C#.
Get a Free API License
You can use the APIs without evaluation limitations by requesting a temporary license.
You can also try the online PowerPoint to Word converter, which is based on the above-mentioned APIs.
In this article, you have learned how to convert PowerPoint PPT or PPTX to Word DOCX using C#. You can simply install the APIs and integrate the provided code in your .NET applications. In addition, you can consult the documentations listed below to explore other features of the APIs. Furthermore, feel free to let us know about your queries via our forum.