Szerkesztés

Megosztás a következőn keresztül:


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

Shapes Object

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.