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.
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:
Effective screenshot of removing all the notes:
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