AddModernComment

CommentCollection.AddModernComment method

Add new modern comment at the end of a collection.

public IModernComment AddModernComment(string text, ISlide slide, IShape shape, PointF position, 
    DateTime creationTime)
ParameterTypeDescription
textStringPlain text of a new modern comment.
slideISlideSlide in a presentation where to add a new modern comment.
shapeIShapeShape on a slide to which a new modern comment is associated.
positionPointFPosition on a slide where to add a new modern comment.
creationTimeDateTimeTime of a modern comment creation.

Return Value

Added modern comment.

Examples

[C#]
using (Presentation pres = new Presentation())
{
    ICommentAuthor newAuthor = pres.CommentAuthors.AddAuthor("Some Author", "SA");
    newAuthor.Comments.AddModernComment("This is modern comment", pres.Slides[0], null, new PointF(100, 100), DateTime.Now);

    pres.Save(outPptxFileName, SaveFormat.Pptx);
}

See Also