Comments

Presentation slides sometimes must go through a review process. Comments are used as a means of communication during the review process.

The following example shows how to create and customize comments on presentation slides using the GemBox.Presentation API.

Screenshot
PowerPoint Library for C# / VB.NET Screenshot

See the full code below, use Run Example to execute.

using System;
using System.IO;
using System.Linq;
using GemBox.Presentation;
using GemBox.Presentation.Media;

class Sample
{
    [STAThread]
    static void Main(string[] args)
    {
        // If using Professional version, put your serial key below.
        ComponentInfo.SetLicense("FREE-LIMITED-KEY");

        PresentationDocument presentation = new PresentationDocument();

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

        // Adds a new comment with a new author in the top-left corner of the slide.
        Comment 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 System.IO
Imports GemBox.Presentation
Imports GemBox.Presentation.Media

Module Samples

    Sub Main()

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

        Dim presentation As PresentationDocument = New PresentationDocument

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

        ' Adds a New comment with a New author in the top-left corner of the slide.
        Dim comment As 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