Skip to content

Instantly share code, notes, and snippets.

@hasegawayosuke
Created February 19, 2018 07:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hasegawayosuke/5b96cdaae8a2026250f1981436edb46c to your computer and use it in GitHub Desktop.
Save hasegawayosuke/5b96cdaae8a2026250f1981436edb46c to your computer and use it in GitHub Desktop.
pptのスライドタイトルを列挙
Option Explicit
Function IsTitle(sh As Shape) As Boolean
On Error GoTo Trap
IsTitle = False
If sh.PlaceholderFormat.Type = ppPlaceholderTitle Then IsTitle = True
Trap:
End Function
Sub EnumPageTitle(p As Presentation)
Dim s As Slide
Dim sh As Shape
Dim t As String
For Each s In p.Slides
For Each sh In s.Shapes
If IsTitle(sh) Then
If sh.HasTextFrame Then
t = sh.TextFrame.TextRange.Text
t = Replace(t, vbCrLf, " ")
t = Replace(t, vbCr, " ")
t = Replace(t, vbLf, " ")
t = Replace(t, vbVerticalTab, " ")
Debug.Print s.SlideIndex & " " & t
End If
End If
Next
Next
End Sub
Sub main()
Call EnumPageTitle(Application.Presentations(1))
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment