« Hands-On with with Freemake Video Downloader 3.0 | Main | Interlude: 2080 - My Megadrive »
Thursday
Nov172011

PowerPoint - Fixing the Aspect Ratio of all the Images in your Slides

Scott Hanselman posted about fixing images that have been distorted in PowerPoint when moving from a 4:3 to to 16:9 aspect ratio. But what if you have many distorted images in your deck. If you manually try to correct those aspect ratios according to the instructions at the link above, you’ll be in for a lot of work.

However, if you aren’t afraid of working with VBA macros then below is a little bit of code that may help. It will reset the aspect ratio for all images in your deck.

----

Sub SetScaleSizeForAllImages()
Dim s As slide
Dim sh As shape
Dim factor As Single
factor = 1.0
For Each s In ActivePresentation.Slides
    For Each sh In s.Shapes
        If sh.Type = msoPicture Then
            sh.ScaleHeight factor, msoTrue
            sh.ScaleWidth factor, msoTrue
        End If
    Next sh
Next s
End Sub

----

PrintView Printer Friendly Version

EmailEmail Article to Friend

Reader Comments (2)

Hi Scott. Thanks for this VBA tip.

I could see this post is dated on 2011. Nowadays PowerPoint 2013 has a cleaver way to change the aspect ratio without distorting the image. In fact, it allows to choose between fitting the content within the new slide dimension (ensure fit) or maximize the current slide. This article has the How-to http://slidemodel.com/change-page-orientation-powerpoint-2013/

Alternatively, there is another trick to do this job manually in earlier versions of PowerPoint (although it is good for a few slides). You can open the 4:3 presentation and then open the 16:9 presentation. From the 4:3 presentation select all the shapes in a slide (CTRL-A) and Copy it to the clipboard. Then go to the 16:9 presentation and paste the content in the new slide. Shapes won't be distorted in this case, however you may need to apply other styles like backgrounds and make sure the shapes are well aligned once copied.

Thanks,
Julian

January 2, 2015 | Unregistered CommenterJulian

Hello Scott
The second VBA tip I found for PowerPoint here, thank you.
This is really useful.
May I ask you what kind of VBA macros are most popular?
Is any reason to create the special section for PowerPoint macros on my site?

Thank you in advance

Joanna Miller

PoweredTemplate.com

April 22, 2016 | Unregistered CommenterJoanna Miller

PostPost a New Comment

Enter your information below to add a new comment.
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>