bgColor Property

       

Returns or sets a Variant that represents the background color of the current page. Read/write.

expression.bgColor

expression   Required. An expression that returns a DispFPHTMLDocument object.

Example

The following example creates a reference to the current document in the active page window, modifies its background color and displays the title of the document. The background of the page will now appear black.

Sub DocumentbgColor()
'Returns the active HTML document and changes color

    Dim objApp As FrontPage.Application
    Dim objDoc As DispFPHTMLDocument
    Dim objPgeWdw As PageWindowEx
    Set objApp = FrontPage.Application
    'Create reference to active page window.
    Set objPgeWdw = objApp.ActivePageWindow
    'Create reference to open document.
    Set objDoc = objPgeWdw.Document

    With objDoc
        'Display title and change background color
        MsgBox "The background color has changed for: " & .Title
        .bgColor = "000000"
    End With
End Sub