News Category

How to remove speaker notes from a presentation slide in C#

2018-10-09 07:03:13 Written by  support iceblue
Rate this item
(0 votes)

We have demonstrated how to use Spire.Presentation to add and get speaker notes in presentation slides. This article will show how to remove the speaker notes in presentation slides in C#.

Firstly, view the sample document contains the speaker notes.

How to remove speaker notes from a presentation slide in C#

Step 1: Create a presentation document and load the document from the file.

Presentation ppt = new Presentation();
ppt.LoadFromFile("Sample.pptx", FileFormat.Pptx2013);

Step 2: Get the first slide from the sample document.

ISlide slide = ppt.Slides[0];

Step 3: Remove the first speak notes:

slide.NotesSlide.NotesTextFrame.Paragraphs.RemoveAt(1);

Remove all the speak notes from the first slide:

slide.NotesSlide.NotesTextFrame.Paragraphs.Clear();

Step 4: Save the document to file.

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

Effective screenshot of removing the first note:

How to remove speaker notes from a presentation slide in C#

Effective screenshot of removing all the notes:

How to remove speaker notes from a presentation slide in C#

Full codes:

Remove the first note in presentation slide:

using Spire.Presentation;
namespace RemoveSpeakerNotes
{

    class Program
    {

        static void Main(string[] args)
        {
            Presentation ppt = new Presentation();
            ppt.LoadFromFile("Sample.pptx", FileFormat.Pptx2013);

            ISlide slide = ppt.Slides[0];

            slide.NotesSlide.NotesTextFrame.Paragraphs.RemoveAt(1);
            ppt.SaveToFile("Result.pptx", FileFormat.Pptx2013);

        }

    }
}

Clear all notes in presentation slide:

Imports Spire.Presentation
Namespace RemoveSpeakerNotes

	Class Program

		Private Shared Sub Main(args As String())
			Dim ppt As New Presentation()
			ppt.LoadFromFile("Sample.pptx", FileFormat.Pptx2013)

			Dim slide As ISlide = ppt.Slides(0)

			slide.NotesSlide.NotesTextFrame.Paragraphs.RemoveAt(1)
			ppt.SaveToFile("Result.pptx", FileFormat.Pptx2013)

		End Sub

	End Class
End Namespace

Additional Info

  • tutorial_title: Remove speaker notes from a presentation slide in C#
Last modified on Friday, 24 September 2021 09:27