AddComment Method

Microsoft PowerPoint Visual Basic

AddComment Method

       

Adds a comment. Returns a Shape object that represents the new comment.

expression.AddComment(Left, Top, Width, Height)

expression   Required. An expression that returns a Shapes object.

Left, Top   Optional Single. The position (in points) of the upper-left corner of the comment bounding box relative to the upper-left corner of the document. By default, the comment is placed in the upper-left corner of the document.

Width, Height   Optional Single. The width and height of the comment, in points. By default, the comment is 100 points high and 100 points wide.

Example

This example adds a comment that contains the text "Test Comment" to myDocument.

Set myDocument = ActivePresentation.Slides(1)
With myDocument.Shapes.AddComment(100, 100, 150, 150)
    .TextFrame.TextRange.Text = .TextFrame _
        .TextRange.Text + "Test Comment"
End With