backgroundColor Property

Microsoft FrontPage Visual Basic

backgroundColor Property

Returns or sets a String that represents the background color for a specified object. The object may be the entire document or an element within the document, such as a table. The backgroundColor property corresponds to the background-color propery for a cascading style sheet.

expression.backgroundColor

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

Remarks

The String for the backgroundColor property may be a color name or a red-green-blue (RGB) color value. For more information about setting colors, see the HTML Color Table.

The backgroundColor property is similar to the bgColor property; however, the backgroundColor property corresponds to the backgroundcolor attribute for the STYLE element, while the bgColor property corresponds to the value of the bgcolor attribute.

You can use the background property to set the backgroundAttachment, backgroundColor, backgroundImage, backgroundPosition, and backgroundRepeat properties. The following code shows what the example below would look like if you were using the background property to set each of these properties.

    ActiveDocument.body.Style.Background = "fixed " & _
    "url(graphics/chelan.jpg) blue center top no-repeat"
  

Example

The following example sets the background color and image settings for the active document.

    With ActiveDocument.body.Style
    .backgroundAttachment = "fixed"
    .backgroundImage = "graphics/chelan.jpg"
    .backgroundColor = "blue"
    .backgroundPosition = "center top"
    .backgroundRepeat = "no-repeat"
End With