Working with Shapes on Slides

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Just as a Microsoft® PowerPoint® presentation consists of a collection of slides, a PowerPoint slide typically consists of one or more Shape objects. Whether a slide contains a picture, a title, text, an OLE object, an AutoShape, a diagram, or other content, everything on the slide is a Shape object.

You can refer to a Shape object on a slide in two ways:

  • By using the value of the shape's index in the collection of shapes on the slide. A shape will have an index value equal to its position in the Shapes collection at the time it was added to the collection.
  • By using the name of the shape. You can specify the name of a Shape object by setting its Name property. By default, PowerPoint sets the name of a shape at the time it is added to a slide. The naming convention is shapetype n,**where shapetype is the type of shape added and n is a number representing 1 plus the number of shapes on the slide when the current shape was added. For the first shape added to a slide, n = 2. To find out more about the types of shapes available in PowerPoint, search the Microsoft PowerPoint Visual Basic Reference Help index for "Shapes collection object."

To work with multiple shapes on a slide, you use the Range method of the Shapes collection. The Range method returns a ShapeRange object containing the shapes specified in the method's argument. If no Index argument is supplied, the Range method returns a ShapeRange object containing all the shapes on a slide. To specify multiple shapes, you can use the Microsoft® Visual Basic® for Applications (VBA) Array function.

In This Section