Class SectionProperties (PowerPoint VBA)

Contains properties and methods for manipulating sections in a presentation.

The main procedure of class SectionProperties is Delete


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

Dim sps as SectionProperties
Set sps = ActivePresentation.SectionProperties

SectionProperties class variables can be set using the Presentation.SectionProperties procedure.


The following procedures in this class have been grouped together and are described on a separate theme page

Add with its procedures AddBeforeSlide and AddSection


This is the main method of the SectionProperties class

Delete - Deletes the section break that sets off the specified section, and optionally deletes all the slides in the section.

Dim lngsectionIndex As Long: lngsectionIndex = 
ActivePresentation.SectionProperties.Delete sectionIndex:=lngsectionIndex, deleteSlides:=True

Other Methods

Move - Moves the specified section to the specified index position, moving the slides in the section along with the section break.

Dim lngsectionIndex As Long: lngsectionIndex = 
Dim lngtoPos As Long: lngtoPos = 
ActivePresentation.SectionProperties.Move sectionIndex:=lngsectionIndex, toPos:=lngtoPos

Rename - Renames the specified section with the specified name.

Dim lngsectionIndex As Long: lngsectionIndex = 
Dim strsectionName As String: strsectionName = 
ActivePresentation.SectionProperties.Rename sectionIndex:=lngsectionIndex, sectionName:=strsectionName


Count returns the number of objects in the specified collection.

Dim lngCount As Long
lngCount = ActivePresentation.SectionProperties.Count

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

Dim objParent As Object
Set objParent = ActivePresentation.SectionProperties.Parent