Home Products Customers Tips VBA OfficeOne on Mac Contact us

CollectSlideTitles

The following function iterates through all slides in the given presentation and collects the title text of the slide if it is present. If the title is not present, it collects the slide name.

Sub CollectSlideTitles(ByVal Pres As Presentation, _
    ByRef SldTitles As Collection)

    Dim Sld As Slide
    Dim SldTitle As String

    For Each Sld In Pres.Slides
        SldTitle = ""
        If Sld.Shapes.HasTitle Then
            If Sld.Shapes.Title.HasTextFrame Then
                If Sld.Shapes.Title.TextFrame.HasText Then
                    SldTitle = Sld.Shapes.Title.TextFrame.TextRange.Text
                End If
            End If
        End If
        If SldTitle = "" Then
            SldTitle = Sld.Name
        End If
        SldTitles.Add SldTitle
    Next
End Sub


Home | Products | Tips | VBA | FAQ | Utilities | Disclaimer | Privacy Policy | Mac | Links | Contact us

Contact OfficeOne on email at officeone@officeoneonline.com. Copyright © 2001-2017 OfficeOne. All rights reserved.

page counter