Share via


Shapes.AddPlaceholder Method (PowerPoint)

Restores a previously deleted placeholder on a slide. Returns a Shape object that represents the restored placeholder.

Syntax

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

expression A variable that represents a Shapes object.

Parameters

Name

Required/Optional

Data Type

Description

Type

Required

PpPlaceholderType

The type of placeholder. Placeholders of type ppPlaceholderVerticalBody or ppPlaceholderVerticalTitle are found only on slides of layout type ppLayoutVerticalText, ppLayoutClipArtAndVerticalText, ppLayoutVerticalTitleAndText, or ppLayoutVerticalTitleAndTextOverChart. You cannot create slides with any of these layouts from the user interface; you must create them programmatically by using the Add method or by setting the Layout property of an existing slide.

Left

Optional

Single

The position (in points) of the upper-left corner of the placeholder relative to the upper-left corner of the document.

Top

Optional

Single

The position (in points) of the upper-left corner of the placeholder relative to the upper-left corner of the document.

Width

Optional

Single

The width of the placeholder, in points.

Height

Optional

Single

The height of the placeholder, in points.

Return Value

Shape

Remarks

If more than one placeholder of a specified type has been deleted from the slide, the AddPlaceholder method will add them back to the slide, one by one, starting with the placeholder that has the lowest original index number.

Example

Suppose that slide two in the active presentation originally had a title at the top of the slide that's been deleted, either manually or with the following line of code.

ActivePresentation.Slides(2).Shapes.Placeholders(1).Delete

This example restores the deleted placeholder to slide two.

Application.ActivePresentation.Slides(2) _

    .Shapes.AddPlaceholder ppPlaceholderTitle

See Also

Concepts

Shapes Object Members

Shapes Object