Convert PPT 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 PPT 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 PPT to Word
Install Aspose.Slides for .NET and Aspose.Words for .NET
Add the two libraries as references in your project.
Create an instance of the Presentation class and Doc class.
Load the PPT presentation you want to convert to Word.
Generate images and texts based on the slides’ contents.
Save the resulting Word document.
Free Online Converter
Other Supported Conversions
You can also convert PowerPoint to files in other formats