PDA

View Full Version : VBA for 16:9 to 4:3



pptbot
09-17-2019, 08:56 AM
Hi, I'm trying to resize my PowerPoint from 16:9 to 4:3. I can do this manually but want this to be automated with vba.
Right now when I do this manually I get the option to choose Maximize or Ensure Fit. I want the vba code to be the Maximize option so after the slide is resized to 4:3 nothing on the objects get shifted or reduced. Looks to me the ppSlideSizeCustom is default to pick Ensure Fit and not sure how to get it to work to choose the other option instead. Any help would be much appreciated.

RayKay
09-20-2019, 09:08 AM
Hi this will help, but you'll need to change the measurements:

Sub Resize()
With Application.ActivePresentation.PageSetup

.SlideWidth = 14.09449 * 72

.SlideHeight = 7.93070866 * 72

End With
End Sub

pptbot
09-20-2019, 08:39 PM
I want to resize to 4:3 with Maximize. Your code is for widescreen and after I changed the measurements it goes to Endure fit and not the Maximize option I wanted to achieve. Maybe this is not possible with VBA?

John Wilson
09-21-2019, 05:31 AM
Maximised is not exposed in the Object Model so I don't think it can be done.

pptbot
09-21-2019, 07:22 AM
Thank you John! That’s really good to know. Does this mean it can only be done with xml code?

John Wilson
09-21-2019, 08:50 AM
My guess is it's hard coded C# and not accessible to the user except through the manual interface.

pptbot
09-21-2019, 09:22 AM
Roger that! Thanks John:)

RayKay
10-01-2019, 06:17 AM
Hi pptbot

At work I often have to switch between 16:9 and 4:3, both directions.

Office 2013 and beyond MS introduced a new way of converting the page layout - and it's a nightmare compared to Office 2007 / 2010. Anyone using the new Maximise / Ensure Fit options will know what I mean!

So my solution would be to have a copy of MS Office (or at least PPT) 2010. Convert from the Page Layout to 16:9 or 4:3, and PPT auto sizes everything for you. Just quickly resize circles.
Save and open with the newer version of PPT you have.

I hope that helps!