Share via

Update page size to 16:9 inch then save it the PPT slide object lost by PowerPoint 2013

Anonymous
2013-06-29T04:28:46+00:00

I install Office 2013, and new one PPT with PowerPoint 2013 by VBA code.

then I add slide with master slide fill, , then I get one PPTX file in Office 2013 PowerPoint.

I find my default PowerPoint page size is 4:3 (10:7.5 inch),

menu: Design->Page Setup-> Page setup dialog to view it.

so I want change the current page size to width: 16, height:12 inch.

after I save this PPTX file, then view it, all slide page content lost in PowerPoint 2013.

I can only duplicate this issue with PowerPoint 2013, The PowerPoint 2010 is not exst this issue, this mean same file to change page size will not cause object lost in PowerPoint 2010, I thinsk this is PowerPoint 2013 issue.

here are VBA code, anyone can help to to check this is PowerPoint 2013 issue or not?

Public Sub SlideMasterBackGroundStyle()

' Delete all exist slidemaster's layout

While ActivePresentation.Designs(1).SlideMaster.CustomLayouts.Count > 1

        For i = ActivePresentation.Designs(1).SlideMaster.CustomLayouts.Count To 1 Step -1

            If ActivePresentation.Designs(1).SlideMaster.CustomLayouts.Count = 1 Then

                Exit For

            End If

            ActivePresentation.Designs(1).SlideMaster.CustomLayouts.Item(i).Delete

        Next i

Wend

' Make slidemaster's layout 1 name

ActivePresentation.Designs(1).SlideMaster.CustomLayouts.Item(1).name = "CustomLayout" + Str(1)

' Make Slide Master's backfround with different backgroundstyle fill

Dim Preset As Integer

For Preset = ActivePresentation.Designs(1).SlideMaster.CustomLayouts.Count + 1 To 12 Step 1

    ActivePresentation.Designs(1).SlideMaster.CustomLayouts.Add (Preset)

    ActivePresentation.Designs(1).SlideMaster.CustomLayouts.Item(Preset).name = "CustomLayout" + Str(Preset)

Next

' Delete all exist slid before  script start

While ActivePresentation.Slides.Count > 0

        For i = ActivePresentation.Slides.Count To 1 Step -1

            If ActivePresentation.Slides.Count = 0 Then

                Exit For

            End If

            ActivePresentation.Slides(i).Delete

        Next i

Wend

' Add slide with slidemaster's layout

For i = 1 To 12 Step 1

    ActivePresentation.Slides.Add(i, ppLayoutBlank).Select

    ActivePresentation.Designs(1).SlideMaster.BackgroundStyle = i

    ActivePresentation.Slides(i).BackgroundStyle = ActivePresentation.Designs(1).SlideMaster.BackgroundStyle

Next

End Sub

Thanks!

Carson

Microsoft 365 and Office | PowerPoint | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

6 answers

Sort by: Most helpful
  1. Anonymous
    2013-07-01T18:01:09+00:00

    What ever works for the OP. My reply prompted you to provide them with another possible answer.  Everyone ones ;)

    Was this answer helpful?

    0 comments No comments
  2. Steve Rindsberg 99,161 Reputation points MVP Volunteer Moderator
    2013-07-01T15:16:55+00:00

    Since you replied to me and not the OP, I feel obliged to mention that I have a pretty decent answer to the problem ... my own Resize add-in:

    http://www.pptools.com/resize/

    Couldn't pass up a straightline like that, Rohn007.  ;-)

    Where should I send the check?

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2013-06-30T03:12:02+00:00

    I don't have an answer to your problem. I did find these articles you may be able to adapt to your needs

    PowerPoint 2013: Widescreen Presentations

    http://blogs.office.com/b/microsoft-powerpoint/archive/2013/01/24/widescreen-presentations.aspx

    Change Presentation Aspect Ratio from Widescreen to Standard (and Vice Versa) in PowerPoint 2013

    http://www.indezine.com/products/powerpoint/learn/interface/change-ratio-widescreen-standard-ppt2013.html

    **Excerpt/Capsule:**Learn how to change a presentation’s aspect ratio from Widescreen to Standard (and vice versa) in PowerPoint 2013.

    Widescreen Defaults in PowerPoint 2013

    http://www.indezine.com/products/powerpoint/learn/powerpoint-2013/widescreen-defaults-ppt2013.html

    Set Standard 4:3 Aspect Ratio as Default in PowerPoint 2013

    http://www.indezine.com/products/powerpoint/learn/interface/set-standard-ratio-default-ppt2013.html

    **Excerpt/Capsule:**Learn how to set the standard 4:3 aspect ratio as the default for new presentations in PowerPoint 2013.

    Was this answer helpful?

    0 comments No comments
  4. Steve Rindsberg 99,161 Reputation points MVP Volunteer Moderator
    2013-06-29T16:37:10+00:00

    A couple of suggestions.  None are really related to the current problem, but might save some hair in the future.

    VB/VBA purport to "fix" things for you when you haven't done them quite right.  Generally, the result is good.  Sometimes it's not, and then it can be VERY tricky to trace down the problem.  As a matter of style and sanity preservation, it's better to let the human make sure it's done correctly in the first place.   So:

    Item is almost always a Long (e.g. CustomLayouts(x) ... x should be a Long, not an Integer as you've defined it).  I would Dim Preset as Long.  It'll also make your code run faster, though you'll need a VERY accurate stopwatch to time the diff. ;-)

    Use & rather than + to concatenate (join) strings.

    Str is a weird little fella.  MS can't even seem to get his documentation straight.  They tell you that Str wants a Long as an argument, then they go on to babble about what happens when this Long (which by definition is a whole number) includes decimal separators (which, as a Long, it cannot).  Throw him away and send me some of whatever they were smoking.

    Str also returns a Variant containing a String rather than a String (which for present purposes shouldn't matter), but it also adds space to the beginning of the string.

    Cstr returns a String, not a Variant, and doesn't pad with spaces etc.  It also handles decimal separators used by other languages correctly (assuming the usage matches the Windows local language settings).

    Was this answer helpful?

    0 comments No comments
  5. Anonymous
    2013-06-29T05:20:33+00:00

    can't repro this and I don't see why  you would get a 4:3 slide, the default is 16:9

    In your code though I would make sure your added layouts have the master shapes

    Something like this (air code)

    Dim ocust As CustomLayout

    Dim Preset As Integer

    For Preset = ActivePresentation.Designs(1).SlideMaster.CustomLayouts.Count + 1 To 12 Step 1

       Set ocust = ActivePresentation.Designs(1).SlideMaster.CustomLayout.Add(Preset)

        ocust.Name = "CustomLayout" + Str(Preset)

        ocust.DisplayMasterShapes = True

    Next

    Also you are using legacy code to add slides (from 2003) This works for me but you should use the addSlide method

    For i = 1 To 12 Step 1

    Set ocust = ActivePresentation.Designs(1).SlideMaster.CustomLayouts(i)

        ActivePresentation.Slides.AddSlide i, ocust

    Was this answer helpful?

    0 comments No comments