color Property
Sets or returns a String specifying a color name or red-green-blue (RGB) value, which represents the color of a specified object.
expression.color
expression Required. An expression that returns one of the objects in the Applies To list.
Remarks
When text is involved, the color property indicates the color of the text for the specified object. Otherwise, the color property indicates the color of the object itself, for example, in the case of lines and borders.
Color values can be specified as color names or Web safe Red-Green-Blue (RGB) color values. For more information on available color names and RGB color values, see the HTML Color Table.
Example
The following example adds a horizontal line to the active document and then formats the color, size, width, and alignment of the line.
Sub InsertLineBefore(ByRef objDoc As FPHTMLDocument, _
ByRef strColor As String, ByRef strSize As String, _
bByRef strWidth As String, ByRef strAlign As String)
Dim objElement As IHTMLElement
Dim intLines As Integer
Dim strID As String
Dim objLine As FPHTMLHRElement
intLines = objDoc.all.tags("hr").Length
strID = "Line" & intLines
Set objElement = objDoc.activeElement
objElement.insertAdjacentHTML where:="beforebegin", _
HTML:="<HR id=""" & strID & """>"
Set objLine = objDoc.body.all.tags("hr").Item(CVar(strID))
With objLine
.Color = strColor
.Size = strSize
.Width = strWidth
.Align = strAlign
End With
End Sub
Use the following example to call the preceding subroutine.
Sub CallInsertLineBefore()
Call InsertLineBefore(objDoc:=ActiveDocument, strColor:="red", _
strSize:="15", strWidth:="75%", strAlign:="right")
End Sub