How to add and get speaker notes in presentation slides in C#

We can add both comments and notes to each slide in PowerPoint documents. Comments are sticky notes and it is helpful to show other information to readers. Speaker notes are a reminder to speaker for not forgets the information they need to mention during the presentation show. With the help of Spire.Presentation, developers can easily add comments to the presentation slides. This article will show you how to add and get the speaker notes in the PowerPoint documents in C#. Here comes to the steps.

Step 1: Create Presentation instance and load file.

Presentation ppt = new Presentation();
ppt.LoadFromFile("sample.pptx");

Step 2: Get the first slide and in the PowerPoint document.

ISlide slide = ppt.Slides[0];

Step 3: Get the NotesSlide in the first slide,if there is no notes, we need to add it firstly.

NotesSlide ns = slide.NotesSlide;
       if (ns == null)
       {
           ns = slide.AddNotesSlide();
       }

Step 4: Adding the text string as the notes.

ns.NotesTextFrame.Text = "Speak notes added by Spire.Presentation";

Step 5: Save the document to file with the Speaker notes.

ppt.SaveToFile("Result.pptx",FileFormat.Pptx2010);

Step 6: Extract the Speak notes.

Console.WriteLine(ns.NotesTextFrame.Text);
Console.ReadKey();

Effective screenshot of the adding speaker notes:

How to add and get speaker notes in presentation slides in C#

Extract the Speaker Notes:

How to add and get speaker notes in presentation slides in C#

Full codes:

static void Main(string[] args)
{
    Presentation ppt = new Presentation();
    ppt.LoadFromFile("sample.pptx");
    ISlide slide = ppt.Slides[0];
    NotesSlide ns = slide.NotesSlide;
        if (ns == null)
            {
                ns = slide.AddNotesSlide();
            } 
    ns.NotesTextFrame.Text = "Speak notes added by Spire.Presentation";
    ppt.SaveToFile("Result.pptx",FileFormat.Pptx2010);
    Console.WriteLine(ns.NotesTextFrame.Text);
    Console.ReadKey();
}