Resize shape to fit text
Sub ResizeAllShapesToFitText()
Dim sld As Slide
Dim shp As Shape
For Each sld In ActivePresentation.Slides
For Each shp In sld.Shapes
ResizeTextShape shp
Next shp
Next sld
MsgBox "All text shapes resized!", vbInformation
End Sub
Private Sub ResizeTextShape(ByVal shp As Shape)
Dim i As Long
If shp.Type = msoGroup Then
For i = 1 To shp.GroupItems.Count
ResizeTextShape shp.GroupItems(i)
Next i
ElseIf shp.HasTextFrame = msoTrue Then
If shp.TextFrame.HasText = msoTrue Then
With shp.TextFrame2
.WordWrap = msoTrue
.AutoSize = msoAutoSizeShapeToFitText
End With
End If
End If
End Sub

Post a Comment