Created
February 19, 2018 07:19
-
-
Save hasegawayosuke/5b96cdaae8a2026250f1981436edb46c to your computer and use it in GitHub Desktop.
pptのスライドタイトルを列挙
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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