Change the size of a shape in Powerpoint 2007 using VBA
Automation in Powerpoint 2007 is not so easy as it seems, because the macro recording is not available any more. What I wanted to do is to change the shape of some graphs to have a specific size and location. The following code changes the size and location of the current shape according to our preferences. Public Sub ChangeImage() With ActiveWindow.Selection.ShapeRange(1) .LockAspectRatio = msoFalse .Width = 720 .Height = 153.9213 .Top = 77.8604 .Left = 0 ' optional '.ZOrder msoSendToBack End With End Sub Public Sub PrintInfo() Debug.Print vbCrLf & "Public Sub ChangeImage()" Debug.Print vbTab & "With ActiveWindow.Selection.ShapeRange(1)" With ActiveWindow.Selection.ShapeRange(1) Debug.Print vbTab & vbTab & ".LockAspectRatio = msoFalse" Debug.Print vbTab & vbTab & ".Width = " & Str(.Width) Debug.Print vbTab & vbTab & ".Heigh...