Hi,
With this code, you can autofit shapes to fit slide width, but it requires to put your dimension (Left, width), which may be not suitable when changing your slide size, it will require setting a new dimension
So how to make shapes autofit slide width without setting the dimension each time?
Thanks
Code:
Sub TextBoxAutoFitWidth4All()
'set the variables
Set pst = ActivePresentation
'start the loops
For Each osld In pst.Slides
For Each oshp In osld.Shapes
pass = 1
'check if we want to skip the shape
If oshp.HasTextFrame = msoFalse Then pass = 0
'we can add as many as we want here in case there is more criteria needed
If pass = 1 Then
With oshp
.LockAspectRatio = False
.Left = 15
.Width = 900
End With
End If
Next oshp
Next osld
End Sub