Code: Select all
Sub chexSections()
Dim tempPres As Presentation
Dim strName As String: strName = InputBox("Name of Section")
Dim L As Long
Dim s As Long
If ActivePresentation.SectionProperties.count > 1 Then
ActivePresentation.SaveCopyAs Environ("TEMP") & "temp.pptx", ppSaveAsOpenXMLPresentation
Set tempPres = Presentations.Open(Environ("TEMP") & "temp.pptx")
For L = 1 To ActivePresentation.SectionProperties.count
If UCase(ActivePresentation.SectionProperties.Name(L)) = UCase(strName) Then
Exit For
End If
Next L
End If
For s = ActivePresentation.SectionProperties.count To 1 Step -1
If s > L Or s < L Then ActivePresentation.SectionProperties.Delete (s), True
Next s
tempPres.SaveAs "C:\Users\gailb\OneDrive\Desktop\" & strName & ".pptx"
End Sub