Share via


aLink Property

Sets or returns a String that represents the color of all active links in the element.

expression.aLink

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

Remarks

The aLink property sets and returns the same results as the alinkColor property.

Example

The following example sets the active, viewed, and regular links, and sets the background color for the active document.

Function ChangeLinkColors(objDoc As FPHTMLDocument, Optional strALink As String, _
        Optional strVLink As String, Optional strLink As String, _
        Optional strBGColor As String) As Boolean

    If strALink <> "" Or strVLink <> "" Or strLink <> "" Or strBGColor <> "" Then
        With objDoc.body
            .aLink = strALink
            .vLink = strVLink
            .link = strLink
            .bgColor = strBGColor
        End With
        ChangeLinkColors = True
    Else
        ChangeLinkColors = False
    End If
End Function

Use the following example to call the preceding function.

Sub CallChangeLinkColors()
    Call ChangeLinkColors(ActiveDocument, _
        "blue", "yellow", "green", "aqua")
End Sub

Applies to | FPHTMLBody Object | IHTMLBodyElement Object