Search code examples
vbapowerpointpowerpoint-2007

how to set image Aspect ratio to 100 % in Powerpoint 2007 using vba?


I am working on automation tool. I want to set image Aspect ratio to 100 % on each slide. Is there any property for that in vba?

Thanks in Adv.


Solution

  • Do you mean like this?

    Option Explicit
    
    Sub Sample()
        Dim shp As Shape
    
        Set shp = ActivePresentation.Slides(1).Shapes("Picture 1")
    
        With shp
            .ScaleHeight 1, msoTrue
            .ScaleWidth 1, msoTrue
        End With
    End Sub