Text Boxes
If you want to get only text boxes like the image below:
The.HasTextFrame
propertycanbeusedinaloopinallpresentationsandshapes.
Code
DimsldAsSlideDimshpAsShapeForEachsldInActivePresentation.SlidesForEachshpInsld.ShapesIfshp.HasTextFrameThenDebug.Print"Texto: " & shp.TextFrame2.TextRange & " " _
; "ID: " & shp.Id & " " _
; "Nome: " & shp.Name
End If
Next shp
Next sld
All Shapes
For all Presentation Shapes, you can get the Type, ID, and Name.
Code
Dim sld As Slide
Dim shp As Shape
Dim sr As Series
Dim txt As Chart
For Each sld In ActivePresentation.Slides
For Each shp In sld.Shapes
Debug.Print "Tipo: " & shp.Type & " " _
; "ID: " & shp.Id & " " _
; "Nome: " & shp.Name
Next shp
Next sld
List of Types
+----------------------+-------+----------------------------------+
| Nome | Valor | Descrição |
+----------------------+-------+----------------------------------+
| msoAutoShape | 1 | AutoForma. |
| msoCallout | 2 | Texto Explicativo. |
| msoCanvas | 20 | Tela. |
| msoChart | 3 | Gráfico. |
| msoComment | 4 | Comentário. |
| msoContentApp | 27 | Suplemento de conteúdo do Office |
| msoDiagram | 21 | Diagrama. |
| msoEmbeddedOLEObject | 7 | Objeto OLE incorporado. |
| msoFormControl | 8 | Controle de formulário. |
| msoFreeform | 5 | Forma Livre. |
| msoGraphic | 28 | Elemento gráfico |
| msoGroup | 6 | Grupo. |
| msoIgxGraphic | 24 | Gráfico SmartArt |
| msoInk | 22 | Tinta |
| msoInkComment | 23 | Comentário à tinta |
| msoLine | 9 | Linha |
| msoLinkedGraphic | 29 | Gráfico vinculado |
| msoLinkedOLEObject | 10 | Objeto OLE vinculado |
| msoLinkedPicture | 11 | Imagem vinculada |
| msoMedia | 16 | Mídia |
| msoOLEControlObject | 12 | Objeto de controle OLE |
| msoPicture | 13 | Imagem |
| msoPlaceholder | 14 | Espaço reservado |
| msoScriptAnchor | 18 | Âncora de script |
| msoShapeTypeMixed | -2 | Tipo de forma misto |
| msoTable | 19 | Tabela |
| msoTextBox | 17 | Caixa de texto |
| msoTextEffect | 15 | Efeito de texto |
| msoWebVideo | 26 | Vídeo da Web |
+----------------------+-------+----------------------------------+
Obs. 1: See The Shapes documentation for more information
Obs. 2: To see what is printed with the command Debug.Print
, you must enable the Immediate Scan window.