OfficeTips Home || VBA Section || General Section || Download Section || Privacy Policy Bookmark and Share

Get theme variant information in PowerPoint 2013

2013 introduces concept of a super theme. A theme which contains variants of the main theme which also supports multiple sizes.

We will look at the example below which enumerates the variant information within a super theme and calculate the sizes that are available for those variants in inches.

Supported versions: PowerPoint 2013

' --------------------------------------------------------------------------------
' Copyright ©1999-2018, 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.
' --------------------------------------------------------------------------------

Sub GetThemeVariantInfo()   
    Const INCH_EMU_CONST = 914400
    
    Dim oTheme As Theme
   Dim oThemeVariants As ThemeVariants
   Dim oThemeVariant As ThemeVariant
    
    Dim path As String
    
    path = "I:\Program Files (x86)\Microsoft Office 2013\Document Themes 15\Facet.thmx"
    
    Set oTheme = Application.OpenThemeFile(path)
    
    Set oThemeVariants = oTheme.ThemeVariants
    
    'Check out http://startbigthinksmall.wordpress.com/2010/01/04/points-inches-and-emus-measuring-units-in-office-open-xml/
    
    For Each oThemeVariant In oThemeVariants
    
        Debug.Print "Variation " & oThemeVariant.Name & " id: " & oThemeVariant.Id
       Debug.Print "Width: " & oThemeVariant.Width / INCH_EMU_CONST & "Height:" & oThemeVariant.Height / INCH_EMU_CONST
        
    Next oThemeVariant    
    
End Sub

 

 

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