We help IT Professionals succeed at work.

Rotate all images on all slides in PPT

1 Endorsement
Last Modified: 2018-10-28
I scanned 100 A3 pages into a PPTX file and then shredded them. When I looked at the file, all slides are in landscape format, while I needed them in portrait.

What would be the quickest way to rotate all 100 scanned images on all 100 slides by 90 degrees?
Watch Question

Karen FalandaysTraining Specialist

Are the slides landscape or the images? If it is the slides, you can navigate to Design>Slide size and change to the desired layout
Jamie Garroch (MVP)PowerPoint Technical Consultant

You can do this very quickly using a bit of PowerPoint VBA code (if you don't know what to do with it, check out my article here).

Option Explicit

' ==============================================
' PowerPoint VBA Macro (runs in the PPT VBE)
' Written by : Jamie Garroch of YOUpresent Ltd.
' Date : 25 OCT 2018
' http://youpresent.co.uk/
' ==============================================
Public Sub RotateAllPictures90()
  Dim oSld As Slide
  Dim oShp As Shape
  ' Change to -90 if you need it to go the other way
  On Error GoTo errorhandler
  ' Process all slides across the active presentation
  For Each oSld In ActivePresentation.Slides
    ' Process all objects on each slide (assumes pictures are not part of a group)
    For Each oShp In oSld.Shapes
      Select Case oShp.Type
        ' Process picture objects only, assuming they are not in placeholders
        Case msoPicture, msoLinkedPicture
          oShp.Rotation = oShp.Rotation + ROTATION_ANGLE
        Case Else ' do nothing
      End Select
Exit Sub

  Debug.Print Err, Err.Description
End Sub

Open in new window


Hi Jamie, thanks a lot! This is what I was looking for, and it worked out-of-the-box (did what it was intended to do).

After running the code I realised that the scanner machine did more than just scan each page and put it into the PPT one image per slide. It actually broke the page into multiple pieces, and stitched them together on the PPT slide. I have no idea what logic it used. Basically they are several images with transparent backgrounds laid on top of each other. Together, they build the original on the scanned page.

So now, I need they routine to build the original image (I guess by Grouping all the images on one slide) before rotating the entire Group.

Could you please help?
PowerPoint Technical Consultant
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)


That worked like a charm. I had to add two more rows to take care of the Scaling between 38 and 39:

      oPics.ScaleHeight Scaling, msoFalse, msoScaleFromMiddle
      oPics.ScaleWidth Scaling, msoFalse, msoScaleFromMiddle


Dim Scaling As Double

between 11 and 12
Jamie Garroch (MVP)PowerPoint Technical Consultant

Great. Glad it worked. Strange things that the scanner was doing! Perhaps exporting to a layered format such as EPS but that format has been disabled for security reasons by Microsoft in the latest versions of Office so not sure what was going on.


1) Don't scan to Powerpoint - Scan to an image format, then import to whatever you need.

2) Don't shred the originals until you are sure you have a good scan - throw them in a 'shred next year' bin if you are prone to recklessness!



Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions