Class ThemeVariant (PowerPoint VBA)

The class ThemeVariant represents a variation (set of colors and fonts) in a theme.

Set

To use a ThemeVariant class variable it first needs to be instantiated, for example

Dim tvt as ThemeVariant
Set tvt = Application.OpenThemeFile.ThemeVariants(Index:=1)

The following procedures can be used to set variables of type ThemeVariant: ThemeVariants.Item and Theme.ThemeVariants

Height

Returns the height of the theme variation.

Dim lngHeight As Long
lngHeight = Application.OpenThemeFile.ThemeVariants(1).Height

Id

Returns a string that represents the ID of the theme variation.

Dim strId As String
strId = Application.OpenThemeFile.ThemeVariants(1).Id

Name

Returns the name of the theme variation.

Dim strName As String
strName = Application.OpenThemeFile.ThemeVariants(1).Name

Parent

Returns the parent for the specified object. Read-only object.

Width

Returns the height of the theme variation.

Dim lngWidth As Long
lngWidth = Application.OpenThemeFile.ThemeVariants(1).Width

ThemeVariants.Count

Returns the number of objects in the specified collection.

Dim lngCount As Long
lngCount = Application.OpenThemeFile.ThemeVariants.Count

ThemeVariants.Item

Returns a single ThemeVariant object from the collection.

Syntax : expression.Item (Index)

Index: The index number of the single ThemeVariant object in the collection to be returned.

Dim tvt As ThemeVariant
Set tvt = Application.OpenThemeFile.ThemeVariants(Index:=1)

ThemeVariants.Parent

Returns the parent for the specified object. Read-only object.