Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Last active September 13, 2021 12:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aspose-com-gists/70bb50b808674e49279057d1f02c3f0c to your computer and use it in GitHub Desktop.
Save aspose-com-gists/70bb50b808674e49279057d1f02c3f0c to your computer and use it in GitHub Desktop.
Convert PowerPoint Presentation to Word Document using C++
// File paths
const String sourceFilePath = u"SourceDirectory\\Slides\\SamplePresentation.pptx";
const String outputFilePath = u"OutputDirectory\\SlidesToWord_out.docx";
// Load the presentation file
auto presentation = System::MakeObject<Aspose::Slides::Presentation>(sourceFilePath);
// Create an instance of the MemoryStream class
auto stream = System::MakeObject<MemoryStream>();
// Save the presentation to the stream
presentation->Save(stream, SaveFormat::Html);
stream->Flush();
stream->Seek(0, SeekOrigin::Begin);
// Create an instance of the Document class using the stream
auto doc = System::MakeObject<Aspose::Words::Document>(stream);
// Save the Word document
doc->Save(outputFilePath, Aspose::Words::SaveFormat::Docx);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment