OfficeTips Home || VBA Section || General Section || Download Section || Privacy Policy

How to reset slide layout

PowerPoint 2007 introduced the ability to create user defined layouts. This is an awesome feature but it also means that some changes are required to adapt code which worked in earlier versions to reset a slide. The trick is to reapply the custom layout that is applied to the slide.


 
Sub ResetSlideLayout()
Dim oSld As Slide

Set oSld = ActiveWindow.Selection.SlideRange(1)
oSld.CustomLayout = oSld.CustomLayout
'You could apply a different layout and then reapply the same layout too
End Sub 

Sirli Reapalu provided this snippet which does the same task.
 
 
Sub ResetSlideLayoutUsingExecuteMso()

ActiveWindow.Selection.SlideRange(1).Select
Application.CommandBars.ExecuteMso ("SlideReset")

End Sub


Copyright 1999-2016 (c) Shyam Pillai. All rights reserved.