Hyperlink Object Example

Hyperlink Object Example

The following example activates the hyperlink associated with a command button in the active form.

Me!Command0.Hyperlink.Follow

The following example sets the HyperlinkAddress property of a command button and then opens the hyperlink when the form is loaded.

To try this example, create a form and add a command button named Command0. Paste the following code into the form's module and switch to Form view:

Private Sub Form_Load()
    Dim ctl As CommandButton
    Set ctl = Me!Command0
    With ctl
        .Visible = False
        .HyperlinkAddress = "http://www.microsoft.com/"
        .Hyperlink.Follow
    End With
End Sub