Export (0) Print
Expand All

ThemeProperties Property

Office 2003

Returns the Theme object for the specified object.

expression.ThemeProperties(PropertyIndex)

expression    An expression that returns a PageWindowEx, WebEx, or WebFile object.

For more detailed information on the individual Type constants shown in the following table, see the tables and lists in the ApplyTheme method.

FpThemeProperties Value Description
fpThemeActiveGraphics 16 or &H10 Returns the active graphics constant.
fpThemeBackgroundImage 1 Returns a background image.
fpThemeCSS 4096 or &H1000 Returns the cascading style sheet.
fpThemeDefaultSettings 16777216 or &H1000000 Returns the theme applied to the web.
fpThemeName 33554432 or &H2000000 Returns the ThemeName constant.
fpThemeNoBackgroundImage 0 Returns a background without an image.
fpThemeNoCSS 0 Returns this property if a cascading style sheet has not been set or is not wanted.
fpThemeNormalColors 0 Returns the color mode for normal color.
fpThemeNormalGraphics 0 Returns the graphics mode for normal graphics.
fpThemePropertiesAll 4369 or &H1111 Returns all of the theme properties. After a theme is applied to an object, the fpThemePropertiesAll property combines all the properties applied to the object.
fpThemePropertiesNone 0 Returns none for the theme properties.
fpThemeVivdColors 256 Returns the vivid colors property.

Example

The following example checks the theme properties for active graphics. If active graphics have been applied, then vivid colors are applied in addition to the theme properties that are already applied to the active page window. If active graphics aren't applied, then active graphics and vivid colors are both applied to the active page window.

    Private Sub GetThemeProperties()
    Dim myPageWindow As PageWindowEx

    Set myPageWindow = ActiveWeb.ActiveWebWindow.ActivePageWindow

    If myPageWindow.ThemeProperties(fpThemeActiveGraphics) Then
        myPageWindow.AppyTheme (fpThemePropertiesAll + _
            fpThemeVividColors)
        Exit Sub
    Else
        myPageWindow.ApplyTheme (fpThemePropertiesAll + _
            fpThemeActiveGraphics + fpThemeVividColors)
   End If
End Sub
  

The following example adds a background picture to the specified file.

    Private Sub AddBackgroundImage()
    Dim myFile As WebFile

    Set myFile = Webs(0).Rootfolder.Files("index.htm")
    If myFile.ThemeProperties(fpThemeBackgroundImage) = 0 Then
        myFile.ApplyTheme myFile.ThemeProperties(fpThemeName), _
            myfile.ThemeProperties(fpThemePropertiesAll) + _
            fpThemeBackgroundImage
    End If
End Sub
  




Show:
© 2014 Microsoft