Visual Basic Reference

Visual Studio 6.0

Hyperlink Object

See Also    Example    Properties    Methods    Events

Using the properties and methods of the Hyperlink object, your ActiveX document or ActiveX control can request a hyperlink-aware container, such as Microsoft Internet Explorer, to jump to a given URL.


Use the NavigateTo method to jump to a URL. For example, the following code presumes an ActiveX document named "axdMyDoc" exists:

UserDocument.Hyperlink.NavigateTo _

If your ActiveX document is contained by a hyperlink-aware container (such as Internet Explorer), and if the container maintains a history of documents, use the GoBack or GoForward methods to go backwards or forwards through the list. However, be sure to use error-checking, as shown in the example below:

Private Sub cmdGoForward_Click()
   On Error GoTo noDocInHistory
   Exit Sub
   Resume Next
End Sub