Add related procedures in class SectionProperties (PowerPoint VBA)
Adds a section immediately before the specified slide index, and returns the index of the new section.
The indices of sections after the newly inserted section are automatically incremented by one. If a section break exists immediately before the specified slide index, the new section is placed after the section break, with the result that the preceding section is now empty, and the specified slide index is now the first slide of the new section. If the presentation does not contain any sections and you call this method, passing a SlideIndex value greater than 1, a new section is created before the first slide and given the default section name.
Dim lngSlideIndex As Long: lngSlideIndex = Dim strsectionName As String: strsectionName = Dim lngAddBeforeSlide As Long lngAddBeforeSlide = ActivePresentation.SectionProperties.AddBeforeSlide(SlideIndex:=lngSlideIndex, sectionName:=strsectionName)
Adds a new section at the specified index position and returns the index of the newly created section.
If a section already exists at the specified index position, calling AddSection is equivalent to adding an empty section immediately before that section. The indices of sections after the newly inserted section are automatically incremented by one. sectionIndex can be one larger than the total number of existing sections, as long as it is less than the maximum number of sections allowed (512); this creates a new, empty section at the end. If no sections exist in the presentation, calling this method and passing a sectionIndex value of 1 creates the first section.
Dim lngsectionIndex As Long: lngsectionIndex = Dim lngAddSection As Long lngAddSection = ActivePresentation.SectionProperties.AddSection(sectionIndex:=lngsectionIndex)