PowerPoint Comments in C# and VB.NET

Presentation slides sometimes need to go through a review process. You can use the Comment feature as a way to communicate during the review process, pointing out changes and suggestions to the author.

With GemBox.Presentation, besides adding comments programmatically to your PowerPoint presentations, you can also change the position of comments. It’s also possible to add comments as a new author whenever you need it.

In the example below, you can learn how to add comments to presentations and also customize them using the Slide.Comments class with GemBox.Presentation.

PowerPoint comments created with GemBox.Presentation
Screenshot of PowerPoint comments created with GemBox.Presentation
using GemBox.Presentation;

class Program
{
    static void Main()
    {
        // If using the Professional version, put your serial key below.
        ComponentInfo.SetLicense("FREE-LIMITED-KEY");

        var presentation = new PresentationDocument();

        // Create new presentation slide.
        var slide = presentation.Slides.AddNew(SlideLayoutType.Custom);

        // Adds a new comment with a new author in the top-left corner of the slide.
        var comment = slide.Comments.Add("GBP", "GemBox.Presentation", "Shows how to use comments with GemBox.Presentation component.");

        // Change comment position.
        comment.Left = Length.From(50, LengthUnit.Centimeter);
        comment.Top = Length.From(10, LengthUnit.Centimeter);

        // Adds a new comment with the same author as the previously added comment.
        slide.Comments.Add("Another comment from GemBox.Presentation.");

        presentation.Save("Comments.pptx");
    }
}
Imports GemBox.Presentation

Module Program

    Sub Main()

        ' If using the Professional version, put your serial key below.
        ComponentInfo.SetLicense("FREE-LIMITED-KEY")

        Dim presentation = New PresentationDocument

        ' Create New presentation slide.
        Dim slide = presentation.Slides.AddNew(SlideLayoutType.Custom)

        ' Adds a New comment with a New author in the top-left corner of the slide.
        Dim comment = slide.Comments.Add("GBP", "GemBox.Presentation", "Shows how to use comments with GemBox.Presentation component.")

        ' Change comment position.
        comment.Left = Length.From(2, LengthUnit.Centimeter)
        comment.Top = Length.From(1, LengthUnit.Centimeter)

        ' Adds a New comment with the same author as the previously added comment.
        slide.Comments.Add("Another comment from GemBox.Presentation.")

        presentation.Save("Comments.pptx")
    End Sub
End Module

See also


Next steps

GemBox.Presentation is a .NET component that enables you to read, write, edit, convert, and print presentation files from your .NET applications using one simple API.

Download Buy