Class Placeholders (PowerPoint VBA)

A collection of all the Shape objects that represent placeholders on the specified slide. To use a Placeholders class variable it first needs to be instantiated, for example


Dim plcs as Placeholders
Set plcs = ActivePresentation.SlideMaster.Shapes

Count

Returns the number of objects in the specified collection.


Dim lngCount As Long
lngCount = ActiveWindow.Selection.SlideRange(1).Shapes.Placeholders.Count

FindByName

Finds the placeholder in the Placeholders collection at the specified index location or with the specified name.

Because it takes a Variant, the FindByName method makes it possible to locate a member of the Placeholders collection by specifying either the index number (an Integer or Long) or the name (a String) of an individual placeholder. Unlike the corresponding methods of other collections, such as Shapes or Slides, the Item method of the Placeholders collection takes only a Long.

FindByName (Index)

Index: The index of the placeholder to be found.


Dim lngIndex As Long: lngIndex = 
Dim shpFindByName As Shape
Set shpFindByName = "Dogs" ActiveWindow.Selection.SlideRange(1).Shapes.Placeholders.FindByName(Index:=lngIndex)

Item

Returns a single Shape object from the specified Placeholders collection.

Item (Index)

Index: The index number of the single Shape object in the collection to be returned.


Dim shpPlaceholder As Shape
Set shpPlaceholder = ActivePresentation.SlideMaster.Shapes.Placeholders(Index:=1)