Shapes.AddComment Method (PowerPoint)
Adds a comment. Returns a Shape object that represents the new comment.
Syntax
expression .AddComment(Left, Top, Width, Height)
expression A variable that represents a Shapes object.
Parameters
Name |
Required/Optional |
Data Type |
Description |
---|---|---|---|
Left |
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. |
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 |
Optional |
Single |
The width of the comment, in points. By default, the comment is 100 points high and 100 points wide. |
Height |
Optional |
Single |
The height of the comment, in points. By default, the comment is 100 points high and 100 points wide. |
Return Value
Shape
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