Resize a picture in powerpoint 2007

I finally got it .. Here is what I did, just in case someone is facing same problem. This re-sizes the image, sets it in the desired position and sends it to the back.

Sub Resize()
    With ActiveWindow.Selection.ShapeRange
        .Height = 2.78 * 72  //72 is the multiplier for the inch
        .Width = 4.17 * 72
        .Left = 0.78 * 72
        .Top = 1.25 * 72
        .ZOrder msoSendToBack  // This sends picture to the back
    End With
End Sub

Thanks for the code. I wanted to be able to automatically resize a bunch of screenshots to fit the size of a slide. I'm guessing other people might need to do this too, so I'm posting what I did.

First, in PowerPoint 2010 in Page Setup, I set the slides to be 16:9 to match the proportions of my monitor/screenshots. Then I added a blank slide and pasted the image for each screenshot. I then ran this code:

Sub ResizeAll()
For each tSlide in ActiveWindow.Presentation.Slides
    tSlide.Select
    With tSlide.Shapes.Item(1) 'assume a blank slide with one image added only
        .Select
        .Height = ActiveWindow.Presentation.PageSetup.SlideHeight
        .Width = ActiveWindow.Presentation.PageSetup.SlideWidth
        .Left = 0
        .Top = 0
    End With
Next
End Sub

Tags:

Vba

Powerpoint