Themes Property Example

This example searches for a specific theme among the themes that are available locally on the client, as well as the themes applied to the ActiveWeb object.

Private Sub SearchAllThemes()
Dim myTheme As Theme
Dim myThemeToFind As String
Dim myIsFound As Boolean

myThemeToFind = “blends”
myIsFound = False

For Each myTheme In Application.Themes
    If myTheme.Label = myThemeToFind Then
        myIsFound = True
        Exit For
    End If
Next

For Each myTheme In ActiveWeb.Themes
    If myTheme.Label = myThemeToFind Then
        myIsFound = True
        Exit For
    End If
Next

End Sub