Share via


Themes Property

Returns a Themes collection that represents the themes available for the specified object.

expression.Themes

*expression   * Required. An expression that returns one of the objects in the Applies to list.

Remarks

The Themes property as applied to the Application object returns the collection of themes available to be applied. When the Themes property is applied to the WebEx object, it returns the collection of themes that have been applied to the Web site. This is the same as the list that appears in the Web's _theme directory. If a theme is applied to a WebEx object, there will be one theme in the collection. However, if a page in a Web site has its own theme, separate from the theme that was applied to the Web site, then the Themes collection for the WebEx object will have two themes in it — the theme that was originally applied to the Web site, and the theme that was applied specifically to the page.

Example

The following example searches for a specific theme among the themes that are available locally on the client, as well as the themes applied to the active Web site.

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

Applies to | Application Object | WebEx Object