backgroundImage Property

Microsoft FrontPage Visual Basic

backgroundImage Property

Returns or sets a String that represents the path and file name for the background image for a specified object. The object may be the entire document or an element within the document, such as a table. The backgroundImage property corresponds to the background-image property for a cascading style sheet.

expression.backgroundImage

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

Remarks

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 top center 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 = "top center"
    .backgroundRepeat = "no-repeat"
End With