Avatar of Member_2_7966563
Member_2_7966563
 asked on

Rotate all images on all slides in PPT

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?
Microsoft PowerPoint

Avatar of undefined
Last Comment
Alan

8/22/2022 - Mon
Karen Falandays

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)

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
  Const ROTATION_ANGLE = 90
  
  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
    Next
  Next
  
Exit Sub

errorhandler:
  Debug.Print Err, Err.Description
End Sub

Open in new window

Member_2_7966563

ASKER
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?
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
ASKER CERTIFIED SOLUTION
Jamie Garroch (MVP)

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Member_2_7966563

ASKER
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

and

Dim Scaling As Double

between 11 and 12
Jamie Garroch (MVP)

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.
Alan

Pro-Tips:

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!

:-P

Alan.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.