Theme Object

Microsoft FrontPage Visual Basic

Theme Object

Multiple objects Themes
Theme

Represents a theme in Microsoft FrontPage. The Theme object is a member of the Themes collection. The Themes collection represents all the themes on the local machine or all themes applied to a specific Web site. Within the Themes collection, individual Theme objects are indexed beginning with zero.

Using the Theme object

Use the Format property to return format information for a theme. The following statement returns the format for the first theme applied to the active Web site.

    myThemeFormat = ActiveWeb.Themes(1).Format
  

Use the Label property to return the name that is displayed in the Theme list box. This is the full name of the theme. The following statement returns the label for the theme.

    myThemeLbl = ActiveWeb.Themes(1).Label
  

Use the Name property to return or apply a theme to a Web page. The Name property contains the directory name for the theme, which is an abbreviated version of the name of the theme as displayed in the Theme list box. The following example lists the names of all themes in the themes collection in the body of the active document.

Note  To run this example, you must have a Web site open that has a theme applied to the active page, the entire Web site, or a specific file in the Web site.

    Sub ListThemes()
    
    Dim objTheme As Theme
    
    For Each objTheme In Application.Themes
        ActiveDocument.body.insertAdjacentText "beforeend", objTheme.Name
    Next

End Sub
  

Use the Version property to return the version number of the theme. The following example returns the version for a theme.

    myThemeVersion = Theme.Version