Export (0) Print
Expand All
1 out of 1 rated this helpful - Rate this topic

Theme Object (PowerPoint)

Office 2013

Represents a theme (a collection of colors, fonts, and effects).

Version Added: PowerPoint 2013

The following code example gets a reference to the currently active theme and then iterates over each theme variation in the theme.

Sub IterateThemeVariants()

    Dim pptTheme As Theme
    Dim pptThemeVariants As ThemeVariants
    Dim pptThemeVariant As ThemeVariant
    Dim path As String
    ' Get a reference to the currently active theme.
    path = "C:\Program Files (x86)\Microsoft Office\Document Themes 15\" & _
        ActivePresentation.TemplateName & ".thmx"
    Set pptTheme = Application.OpenThemeFile(path)
    ' Get a reference to all of the variations in the theme.
    Set pptThemeVariants = pptTheme.ThemeVariants
    ' Iterate over each variation of the theme and print
    ' its ID.
    For Each pptThemeVariant In pptThemeVariants
        Debug.Print "Variation id: " & pptThemeVariant.Id
    Next pptThemeVariant

End Sub
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2014 Microsoft. All rights reserved.