Replace a slide’s speaker notes without replacing its visible title. A notes page holds a slide’s notes; a notes master supplies shared notes-page structure and formatting. A slide without a notes page needs an existing notes master in the deck.
dotnet add package RecursiveAI.OneDocument.PresentationsRequires .NET 10 (net10.0); .NET 9 and earlier aren’t supported.
input.pptx is in the example zip: one slide titled “Quarterly review”, with a notes master but no notes page.
using RecursiveAI.OneDocument .Presentations; using var deck = Presentation.Open("input.pptx"); deck.Slides[0].SetNotesText("Explain."); deck.SaveAs("review.pptx");
Writes review.pptx with “Explain.” as the first slide’s notes. The snippet prints no console output.
Unzip the example, then dotnet run.
Full program
The full program opens the freely redistributable example created for this recipe, writes the notes, then reopens the file to read both notes and title.
using RecursiveAI.OneDocument.Presentations; using var deck = Presentation.Open("input.pptx"); var slide = deck.Slides[0]; Console.WriteLine($"Notes part before: {slide.Notes is not null}"); slide.SetNotesText("Explain the revenue chart."); deck.SaveAs("review.pptx"); using var reopened = Presentation.Open("review.pptx"); Console.WriteLine($"Notes: {reopened.Slides[0].Notes?.NotesText}"); Console.WriteLine($"Slide: {reopened.Slides[0].Title}");
Notes part before: False Notes: Explain the revenue chart. Slide: Quarterly review
If a slide has no notes page and the presentation has no notes master, SetNotesText throws InvalidOperationException: it does not create a notes master.
Variations
Clear the notes text. Run this after the full program.
using RecursiveAI.OneDocument.Presentations; using var deck = Presentation.Open("review.pptx"); deck.Slides[0].SetNotesText(""); deck.SaveAs("cleared.pptx"); Console.WriteLine($"Notes length: {deck.Slides[0].Notes!.NotesText.Length}");
Notes length: 0Related recipes
The short answer
Open the PPTX, select a slide and call SetNotesText. Save the result to a new PPTX. For a slide with no notes page, OneDocument creates that page and its relationships using the presentation’s existing notes master. It does not create the master itself.
How do I edit speaker notes in PowerPoint?
For a programmatic edit, SetNotesText writes to the notes page’s body placeholder. It is separate from setting the text of a shape on the slide. Editing slide-body text will not update the speaker’s notes, and editing notes does not replace the slide title.
The snippet at the top operates on the first slide of the included deck. For your own presentation, open its path instead and select the intended slide from Slides. Do not assume a deck is nonempty before using index zero. Write a separate output path if you want to retain the source file.
This is a file-editing example, not automation of the running PowerPoint user interface. To edit while presenting in PowerPoint itself, Microsoft describes the notes pane in Presenter view.
How do I add speaker notes in PowerPoint?
When a notes page is missing, SetNotesText needs the deck’s notes master before it can construct a page.
In that case the library creates a notes-slide part and its content-type entry. It writes relationships from the new page to the slide and notes master, and a relationship from the slide back to its notes page. The presentation editing documentation describes this behavior.
Adding notes directly to a new Presentation.Create() deck is not supported by this operation because the deck lacks a notes master. Instead, open a template containing a notes master, such as input.pptx in the zip, and add or edit slides there before calling SetNotesText. A deck that already has a notes page can be edited without taking the creation path.
How do I extract speaker notes from PowerPoint?
Read each slide’s nullable Notes property, then its NotesText. The full program shows the read for one slide after reopening the output. A null Notes means there is no notes part for that slide; it is different from a notes page whose text is empty.
NotesText reads the notes body placeholder rather than treating all text on a notes page as speaker text. That distinction matters because notes pages can also contain slide images and other placeholders. Read the body notes when exporting talking points, not the visible slide title.
Saving a notes edit does not rebuild the whole presentation. The documented round-trip contract copies unedited parts as stored and keeps unedited elements in edited parts in order.
To clear the talking points, pass an empty string as the variation does. This clears text; it does not mean the notes part is deleted. Reopen the saved deck and inspect its NotesText when you need to confirm the final stored result.