Logo

Hacker’s Guide to Visual FoxPro
An irreverent look at how Visual FoxPro really works. Tells you the inside scoop on every command, function, property, event and method of Visual FoxPro.

The Hyperlink object allows you to include links to the World Wide Web as native controls within your FoxPro forms. These links work within stand-alone FoxPro applications and in Active Documents.

Method

Purpose

GoBack

Moves to the previous link in the history list.

GoForward

Moves to the next link in the history list.

NavigateTo

Navigates to the specified link. Starts a browser if used in a stand-alone FoxPro application.

The hyperlink object is a nonvisual class with the usual class properties and methods. But its main purpose in life is hosting the three methods above, providing the ability to navigate to hyperlinks.

Navigating to a hyperlink is not just a matter of issuing a RUN /N “MyLink.HTML” call. The hyperlink object shields us from the steps needed to locate the program charged with hosting HTML files, invoking it, and passing it the correct address. In addition, when the hyperlink is within a container supporting browsing history (typically when you’re hosting an Active Document in Internet Explorer), the GoForward and GoBack methods allow you to programmatically move through the history list.

Example

* In a stand-alone app, you can invoke a browser with:
oLink = CREATEOBJECT("hyperlink")
oLink.NavigateTo("http://www.microsoft.com/vfoxpro")
* You don't need to be limited to the World Wide Wait
* Browsers can also host other documents, if their
* associated viewer applications are installed:
oLink.NavigateTo("d:\My Documents\MyLetter.DOC")

See Also

GoForward, GoBack, NavigateTo