Class CustomLayout (PowerPoint VBA)

The class CustomLayout represents a custom layout associated with a presentation design. The CustomLayout object is a member of the CustomLayouts collection.

The main procedures of class CustomLayout are Copy, Delete, Select and CustomLayouts.Add

Set

To use a CustomLayout class variable it first needs to be instantiated, for example

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

The following procedures can be used to set variables of type CustomLayout: Duplicate, CustomLayouts.Item, CustomLayouts.Add, CustomLayouts.Paste, Slide.CustomLayout, SlideRange.CustomLayout and Master.CustomLayouts

Themes

Some procedures in this class have been grouped together in themes and are described on separate theme pages

Display/Show with its procedures DisplayMasterShapes and SlideShowTransition
Format with its procedures Height, ThemeColorScheme and Width
Name with its procedures MatchingName and Name

Methods

These are the main methods of the CustomLayout class

Copy - Copies the specified object to the Clipboard.

ActivePresentation.SlideMaster.CustomLayouts(1).Copy

Delete - Deletes the specified object.

ActivePresentation.SlideMaster.CustomLayouts(1).Delete

Select - Selects the specified CustomLayout object.

ActivePresentation.SlideMaster.CustomLayouts(1).Select

CustomLayouts.Add - Returns a CustomLayout object that represents a new custom layout.

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

Properties

Background returns a ShapeRange object that represents the slide background.

Dim sreBackground As ShapeRange
Set sreBackground = ActivePresentation.SlideMaster.CustomLayouts(1).Background

CustomerData returns a CustomerData object.

Dim cdaCustomerData As CustomerData
Set cdaCustomerData = ActivePresentation.SlideMaster.CustomLayouts(1).CustomerData

Design returns a Design object that represents the design template associated with the specified custom layout.

Dim dsgDesign As Design
Set dsgDesign = ActivePresentation.SlideMaster.CustomLayouts(1).Design

FollowMasterBackground determines whether the specified custom layout follows the slide master background.

ActivePresentation.SlideMaster.CustomLayouts(1).FollowMasterBackground = msoTrue

Guides returns the Guides collection associated with a custom layout.

Dim gdsGuides As Guides
Set gdsGuides = ActivePresentation.SlideMaster.CustomLayouts(1).Guides

HeadersFooters returns a HeadersFooters collection that represents the header, footer, date and time, and slide number associated with the specified custom layout.

Dim hfsHeadersFooters As HeadersFooters
Set hfsHeadersFooters = ActivePresentation.SlideMaster.CustomLayouts(1).HeadersFooters

Hyperlinks returns a Hyperlinks collection that represents all hyperlinks on the slide associated with the specified custom layout.

Dim hypsHyperlinks As Hyperlinks
Set hypsHyperlinks = ActivePresentation.SlideMaster.CustomLayouts(1).Hyperlinks

Index returns the index position of the specified custom layout in the CustomLayouts collection.

Dim lngIndex As Long
lngIndex = ActivePresentation.SlideMaster.CustomLayouts(1).Index

Parent returns a reference to the slide master object that is the parent of the specified CustomLayout object. Read-only.

Dim objParent As Object
Set objParent = ActivePresentation.SlideMaster.CustomLayouts(1).Parent

Preserved determines whether the specified custom layout is preserved from changes.

ActivePresentation.SlideMaster.CustomLayouts(1).Preserved = msoTrue

Shapes returns a Shapes collection representing all the layout elements included in the specified custom layout.

Dim shpsShapes As Shapes
Set shpsShapes = ActivePresentation.SlideMaster.CustomLayouts(1).Shapes

TimeLine returns a TimeLine object that represents the animation timeline for the slide associated with the specified custom layout.

Dim tleTimeLine As TimeLine
Set tleTimeLine = ActivePresentation.SlideMaster.CustomLayouts(1).TimeLine

CustomLayouts.Count returns the number of objects in the specified collection.

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

CustomLayouts.Parent returns the parent object for the specified object. Read-only.

Dim objParent As Object
Set objParent = ActivePresentation.SlideMaster.CustomLayouts.Parent