Skip to content

Instantly share code, notes, and snippets.

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/6212a97ef3c254fc335ccc7fe6527376 to your computer and use it in GitHub Desktop.
Save aspose-com-gists/6212a97ef3c254fc335ccc7fe6527376 to your computer and use it in GitHub Desktop.
Working with notes in PowerPoint presentations using C++
Examples for Working with notes in PowerPoint presentations using C++
// File paths
const String sourceFilePath = u"SourceDirectory\\SamplePresentation.pptx";
const String outputFilePath = u"OutputDirectory\\added-slide-notes.pptx";
// Load the Presentation file
SharedPtr<Presentation> presentation = MakeObject<Presentation>(sourceFilePath);
SharedPtr<INotesSlideManager> notesManager = presentation->get_Slides()->idx_get(0)->get_NotesSlideManager();
// Add new slide notes
SharedPtr<INotesSlide> note = notesManager->AddNotesSlide();
// Set the note text
note->get_NotesTextFrame()->set_Text(u"Test");
// Save Presentation file
presentation->Save(outputFilePath, Aspose::Slides::Export::SaveFormat::Pptx);
// Source PowerPoint file
const String sourceFilePath = u"SourceDirectory\\slide-notes.pptx";
// Load the Presentation file
SharedPtr<Presentation> presentation = MakeObject<Presentation>(sourceFilePath);
SharedPtr<INotesSlideManager> notesManager = presentation->get_Slides()->idx_get(0)->get_NotesSlideManager();
// Read slide notes
SharedPtr<INotesSlide> note = notesManager->get_NotesSlide();
Console::WriteLine(note->get_NotesTextFrame()->get_Text());
// File paths
const String sourceFilePath = u"SourceDirectory\\slide-notes.pptx";
const String outputFilePath = u"OutputDirectory\\removed-slide-notes.pptx";
// Load the Presentation file
SharedPtr<Presentation> presentation = MakeObject<Presentation>(sourceFilePath);
SharedPtr<INotesSlideManager> notesManager = presentation->get_Slides()->idx_get(0)->get_NotesSlideManager();
// Remove slide notes
notesManager->RemoveNotesSlide();
// Save Presentation file
presentation->Save(outputFilePath, Aspose::Slides::Export::SaveFormat::Pptx);
// File paths
const String sourceFilePath = u"SourceDirectory\\slide-notes.pptx";
const String outputFilePath = u"OutputDirectory\\updated-slide-notes.pptx";
// Load the Presentation file
SharedPtr<Presentation> presentation = MakeObject<Presentation>(sourceFilePath);
SharedPtr<INotesSlideManager> notesManager = presentation->get_Slides()->idx_get(0)->get_NotesSlideManager();
// Access slide notes
SharedPtr<INotesSlide> note = notesManager->get_NotesSlide();
// Update the notes
note->get_NotesTextFrame()->set_Text(u"Test Updated");
// Save Presentation file
presentation->Save(outputFilePath, Aspose::Slides::Export::SaveFormat::Pptx);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment