fgColor Property

       

Returns or sets a Variant that defines the foreground color of the current document. The foreground color corresponds to the color of the text. Read/write.

expression.fgColor

expression   Required. An expression that returns a DispFPHTMLDocument object.

Remarks

Valid entries are hexadecimal color values or enumerated color constants.

Example

The following example sets the foreground color of the document to the hexadecimal value corresponding to the color blue and displays a message to the user.

Sub SetFGColor()
'Sets the foreground color of the current document

    Dim objApp As FrontPage.Application
    Dim objDoc As DispFPHTMLDocument

    Set objApp = FrontPage.Application
    Set objDoc = objApp.ActiveDocument
    'Set foreground color to blue
    objDoc.fgColor = "3333FF"
    MsgBox "The foreground color of the current document is now blue."

End Sub