title | keywords | f1_keywords | api_name | ms.assetid | ms.date | ms.localizationpriority | ||
---|---|---|---|---|---|---|---|---|
Shapes.AddShape method (PowerPoint) |
vbapp10.chm543012 |
|
|
2bc6cce5-3461-61ff-083d-bd36ee71cb59 |
06/08/2017 |
medium |
Creates an AutoShape. Returns a Shape object that represents the new AutoShape.
expression. AddShape
( _Type_
, _Left_
, _Top_
, _Width_
, _Height_
)
expression A variable that represents a Shapes object.
Name | Required/Optional | Data type | Description |
---|---|---|---|
Type | Required | MsoAutoShapeType | Specifies the type of AutoShape to create. |
Left | Required | Single | The position, measured in points, of the left edge of the AutoShape relative to the left edge of the slide. |
Top | Required | Single | The position, measured in points, of the top edge of the AutoShape relative to the top edge of the slide. |
Width | Required | Single | The width of the AutoShape, measured in points. |
Height | Required | Single | The height of the AutoShape, measured in points. |
Shape
To change the type of an AutoShape that you've added, set the AutoShapeType property.
This example adds a rectangle to myDocument.
Set myDocument = ActivePresentation.Slides(1)
myDocument.Shapes.AddShape Type:=msoShapeRectangle, _
Left:=50, Top:=50, Width:=100, Height:=200
[!includeSupport and feedback]