Table of contents
TOC
Collapse the table of content
Expand the table of content

Shapes.AddShape Method (PowerPoint)

office 365 dev account|Last Updated: 6/12/2017
|
1 Contributor

Creates an AutoShape. Returns a Shape object that represents the new AutoShape.

Syntax

expression. AddShape( Type, Left, Top, Width, Height )

expression A variable that represents a Shapes object.

Parameters

NameRequired/OptionalData TypeDescription
TypeRequiredMsoAutoShapeTypeSpecifies the type of AutoShape to create.
LeftRequiredSingleThe position, measured in points, of the left edge of the AutoShape relative to the left edge of the slide.
TopRequiredSingleThe position, measured in points, of the top edge of the AutoShape relative to the top edge of the slide.
WidthRequiredSingleThe width of the AutoShape, measured in points.
HeightRequiredSingleThe height of the AutoShape, measured in points.

Return Value

Shape

Remarks

To change the type of an AutoShape that you've added, set the AutoShapeType property.

Example

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

See also

Concepts

Shapes Object

© 2018 Microsoft