Skip to content

Instantly share code, notes, and snippets.

@josephfinlayson
Created April 30, 2013 14:59
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 josephfinlayson/5489278 to your computer and use it in GitHub Desktop.
Save josephfinlayson/5489278 to your computer and use it in GitHub Desktop.
Select shapes by style and colour, extract text, in powerpoint
Sub GetAllText()
Dim p As Presentation: Set p = ActivePresentation
Dim s As Slide
Dim sh As Shape
For Each s In p.Slides
For Each sh In s.Shapes
If sh.HasTextFrame Then
If sh.Type = msoShapeStylePreset1 Then
If sh.Fill.ForeColor = RGB(242, 242, 242) Or sh.Fill.BackColor = RGB(242, 242, 242) Then
If sh.TextFrame.HasText Then
Debug.Print sh.TextFrame.TextRange.Text
End If
End If
End If
End If
Next
Next
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment