Consulting

Results 1 to 8 of 8

Thread: VBA for 16:9 to 4:3

  1. #1
    VBAX Newbie
    Joined
    Jan 2018
    Posts
    5
    Location

    VBA for 16:9 to 4:3

    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.

  2. #2
    VBAX Contributor
    Joined
    Dec 2018
    Location
    South London
    Posts
    115
    Location
    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

  3. #3
    VBAX Newbie
    Joined
    Jan 2018
    Posts
    5
    Location
    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?

  4. #4
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,093
    Location
    Maximised is not exposed in the Object Model so I don't think it can be done.
    Last edited by John Wilson; 09-21-2019 at 05:42 AM.
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  5. #5
    VBAX Newbie
    Joined
    Jan 2018
    Posts
    5
    Location
    Thank you John! That’s really good to know. Does this mean it can only be done with xml code?

  6. #6
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,093
    Location
    My guess is it's hard coded C# and not accessible to the user except through the manual interface.
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  7. #7
    VBAX Newbie
    Joined
    Jan 2018
    Posts
    5
    Location
    Roger that! Thanks John

  8. #8
    VBAX Contributor
    Joined
    Dec 2018
    Location
    South London
    Posts
    115
    Location
    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!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •