Convert PPTX to Word in C#

Powerful cross-platform .NET API for converting PowerPoint to Word using C# code on NET Framework, .NET Core, Windows Azure, Mono or Xamarin Platforms

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

Aspose.Slides for .NET and Aspose.Words for .NET are powerful .NET 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 C#

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

C# code for converting PowerPoint to Word

using var presentation = new Presentation();
var doc = new Document();
var builder = new DocumentBuilder(doc);
foreach (var slide in presentation.Slides)
{
    // generates and inserts slide image
    using var bitmap = slide.GetThumbnail(1, 1);
    using var stream = new MemoryStream();
    bitmap.Save(stream, ImageFormat.Png);
    stream.Seek(0, SeekOrigin.Begin);
    using var skBitmap = SKBitmap.Decode(stream);
    builder.InsertImage(skBitmap);

    // inserts slide texts
    foreach (var shape in slide.Shapes)
    {
        if (shape is AutoShape autoShape)
        {
            builder.Writeln(autoShape.TextFrame.Text);
        }
    }

    builder.InsertBreak(BreakType.PageBreak);
}
doc.Save("document.docx");

How to convert PPTX to Word

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

  2. Add the two libraries as references in your project.

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

  4. Load the PPTX presentation you want to convert to Word.

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

  6. Save the resulting Word document.

Free Online Converter

How to Convert PPT to HTML in Python

Other Supported Conversions

You can also convert PowerPoint to files in other formats