Last active
April 7, 2021 10:53
-
-
Save aspose-com-gists/6212a97ef3c254fc335ccc7fe6527376 to your computer and use it in GitHub Desktop.
Working with notes in PowerPoint presentations using C++
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Examples for Working with notes in PowerPoint presentations using C++ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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