Home | VBA Section | General Section | Downloads | Licensing | Privacy Policy

How to apply designs to various slides (2002 and later)

 

PowerPoint 2002 introduced multiple masters and it is supported in the PowerPoint Object model too.
Let us see how we can assign different designs to various slides. The example below assumes that the presentation has multiple designs in it
 

 
' ---------------------------------------------------------------------
'' Copyright ©1999-2007 Shyam Pillai. All Rights Reserved.
' ---------------------------------------------------------------------
' You are free to use this code within your own applications, add-ins,
' documents etc but you are expressly forbidden from selling or
' otherwise distributing this source code without prior consent.
' This includes both posting free demo projects made from this
' code as well as reproducing the code in text or html format.
' ---------------------------------------------------------------------
' Every slide has a Design object associated with it. 
' Set this property to the design you wish to apply to a given slide range.
' To assign the 2nd template to the 2nd slide.
' Note: If a design ceases to be used by any of the slides,
' it will be removed from the Designs collection unless the Preserved
' property for that design is set to TRUE.
With ActivePresentation
    .Slides(2).Design = .Designs(2)
End With

' To assign the 3rd template to a slide range
With ActivePresentation
    .Slides.Range(Array(1, 3)).Design = .Designs(3)
End With
 
 

Copyright © 1999-2008 Shyam Pillai. All rights reserved.