Positioning 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.

When you add a shape to a slide, the method you use typically requires you to specify values to establish the dimensions of the shape. In some cases, as with the AddTextEffect method (illustrated in the AddTestSlideAndShapes procedure shown earlier in "Adding Shapes to Slides"), you specify values for the Left and Top properties of the shape (the height and width of the shape is determined by the text it contains). In other cases (as with the AddTextbox method, also illustrated in the AddTestSlideAndShapes procedure), you must specify values for the Shape object's Left, Top, Width, and Height properties.

The height and width of shapes are specified in pixels. The default slide size is 720 pixels wide and 540 pixels high. The center of a slide is 360 pixels from the left edge of the slide and 270 pixels from the top of the slide. You can center any shape horizontally by using the formula (SlideWidth - ShapeWidth) / 2. You can center any shape vertically by using the formula (SlideHeight - ShapeHeight) / 2. You can programmatically specify or determine the height and width setting for the slides in a presentation by using the Presentation object's PageSetup property to return a PageSetup object, and then use the PageSetup object's SlideHeight and SlideWidth properties. This technique is also illustrated in the AddTestSlideAndShapes procedure shown earlier.

To position one or more shapes on a slide either in relation to the slide or to other shapes on the slide, you can use the Align or Distribute methods of a ShapeRange object.

See Also

Working with Shapes on Slides | Adding Shapes to Slides | Working with Text in a Shape