Sub SeleccionarCuadrosDeTexto()
Dim slide As slide
Dim shape As shape
Dim selectedShapes() As shape
Dim i As Integer
' Obtiene la referencia a la diapositiva actual
Set slide = ActiveWindow.View.slide
' Inicializa el contador de formas seleccionadas
i = 0
' Recorre todos los objetos en la diapositiva
For Each shape In slide.Shapes
' Verifica si el objeto es un cuadro de texto
If shape.Type = msoTextBox Then
' Aumenta el tamaño de la matriz y agrega la forma a la matriz
ReDim Preserve selectedShapes(1 To i + 1)
Set selectedShapes(i + 1) = shape
i = i + 1
End If
Next shape
' Deselecciona cualquier objeto seleccionado actualmente
slide.Shapes.Range(Array()).Select
' Selecciona todas las formas de la matriz
For i = LBound(selectedShapes) To UBound(selectedShapes)
selectedShapes(i).Select (msoTrue)
Next i
End Sub
Now the following does work... partially, cause it only selects ONE textbox, not all of them, and does not select other shapes or objects that contain text:
Sub SeleccionarCuadrosDeTexto()
Dim slide As slide
Dim shape As shape
' Obtiene la referencia a la diapositiva actual
Set slide = ActiveWindow.View.slide
' Deselecciona cualquier objeto seleccionado actualmente
On Error Resume Next
slide.Shapes.Range(Array()).Select
On Error GoTo 0
' Recorre todos los objetos en la diapositiva
For Each shape In slide.Shapes
' Verifica si el objeto es un cuadro de texto
If shape.HasTextFrame Then
' Selecciona el cuadro de texto
shape.Select (msoTrue)
End If
Next shape
End Sub
I cannot fathom why such a simple task is so complicated to automate on Powerpoint.