How to Add Comments on PowerPoint Slides

A comment is a note that you can attach to a phrase or a paragraph on a slide, or to an entire slide. Viewing comments that were created by the author, readers can learn some more information about the contents; on the contrary, comments can be added by readers to provide the author reviews and feedbacks.

Spire.Presentation for .NET, especially designed for developers to manipulate PowerPoint documents with C#, VB.NET, allows users to insert comments in PowerPoint slides with several lines of core code. The following section will present how we can achieve this purpose using Spire.Presentation.

Step 1: Create a new instance of Spire.Presnetation class and load a sample file.

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

Step 2: Call CommentAuthorList.AddAuthor(author name, string initials) method to add comment author.

ICommentAuthor author = presentation.CommentAuthors.AddAuthor("E-iceblue", "comment:");

Step 3: Call presentation.Slides[].AddComment() method to add a comment on a spicific slide.The Comment class includes information like author who added slide comment, time of creation, the position of comment on slide and the comment text.

presentation.Slides[0].AddComment(author, "This paragraph represents what people do on Mothers'Day", new System.Drawing.PointF(21,31), DateTime.Now);

Step 4: Save and launch the document.

presentation.SaveToFile("comment.pptx", FileFormat.Pptx2010);
System.Diagnostics.Process.Start("comment.pptx");

Full code:

[C#]
            //create PPT document and load file
            Presentation presentation = new Presentation();
            presentation.LoadFromFile("sample.pptx");
           //comment author
            ICommentAuthor author = presentation.CommentAuthors.AddAuthor("E-iceblue", "comment:");
    //add comment
            presentation.Slides[0].AddComment(author, "This paragraph represents what people do on Mothers'Day", new System.Drawing.PointF(21,31), DateTime.Now);
           //save the document
            presentation.SaveToFile("comment.pptx", FileFormat.Pptx2010);
            System.Diagnostics.Process.Start("comment.pptx");
[VB.NET]
           'create PPT document and load file
            Dim presentation As Presentation =  New Presentation() 
            presentation.LoadFromFile("sample.pptx")
           'comment author

            Dim author As ICommentAuthor =  presentation.CommentAuthors.AddAuthor("E-iceblue","comment:") 
          'add comment
            presentation.Slides(0).AddComment(author,"This paragraph represents what people do on Mothers'Day",New System.Drawing.PointF(21,31),DateTime.Now)
           'save the document
            presentation.SaveToFile("comment.pptx", FileFormat.Pptx2010)
            System.Diagnostics.Process.Start("comment.pptx")

Screen Effect:

Add Comments on PowerPoint Slides