Class CustomLayouts (PowerPoint VBA)

The class CustomLayouts represents a set of custom layouts associated with a presentation design. To use a CustomLayouts class variable it first needs to be instantiated, for example


Dim cls as CustomLayouts
Set cls = ActivePresentation.SlideMaster.CustomLayouts

Add

Returns a CustomLayout object that represents a new custom layout.

Add (Index)

Index: The index number of the custom layout. The default value is -1, which means that if the Index argument is omitted, the new custom layout is added at the end of existing custom layouts.


Dim lngIndex As Long: lngIndex = 
Dim clt As CustomLayout
Set clt = ActivePresentation.SlideMaster.CustomLayouts.Add(Index:=lngIndex)

Count

Returns the number of objects in the specified collection.


Dim lngCount As Long
lngCount = ActivePresentation.SlideMaster.CustomLayouts.Count

Item

Returns a single object from the specified collection.

Item (Index)

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


Dim clt As CustomLayout
Set clt = ActivePresentation.SlideMaster.CustomLayouts(Index:=1)

Paste

Pastes the slides on the Clipboard into a custom layout and adds the custom layout to the CustomLayouts collection.

Paste (Index)

Index: The index number of the custom layout before which the new custom layout is pasted. If this argument is omitted, the new custom layout is pasted at the end of the CustomLayouts collection.


Dim cltPaste As CustomLayout
Set cltPaste = ActivePresentation.SlideMaster.CustomLayouts.Paste()