Wednesday, November 18, 2009

PowerPoint: Resizing all the Shapes of a particular shape type

'*************************************************************
' Resizing all the Shapes of a particular shape type.
' This example sets the height and width of all charts which
' were pasted from Excel into PowerPoint as Linked charts
' This example can be used to format other shape types by
' changing the msoShapeType enumeration.
' For a list of Shape types (enumerations) check out the
' Enumerations topic
'*************************************************************

Sub SetLinkedChartSize()
Dim s As Slide
Dim shp As Shape

For Each s In ActivePresentation.Slides
For Each shp In s.Shapes
If shp.Type = msoLinkedOLEObject Then
With shp
.LockAspectRatio = msoFalse
.Height = 255
.Width = 400
End With
End If
Next shp
Next s

End Sub

No comments:

Post a Comment