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