Share via


FollowHyperlink Method [Visio 2003 SDK Documentation]

Navigates to an arbitrary hyperlink.

object**.FollowHyperlink** (Address, SubAddress, [ExtraInfo], [Frame], [NewWindow], [res1], [res2], [res3] )

object     Required. An expression that returns a Document object.

Address    Required String. The address to which you want to navigate. If you pass an incorrect or non-existent path or filename for Address, Visio displays an error message.

SubAddress    Required String. The secondary address to which you want to navigate; if you don't need this information, pass an empty string. If Address is the full path of a Visio document that contains multiple pages, for example, you can use SubAddress to specify the page.

ExtraInfo    Optional Variant. Extra URL request information to use in resolving the URL.

Frame    Optional Variant. The HTML frame to which to navigate.

NewWindow    Optional Variant. Specifies if a new window is to be opened. Passing any non-zero number or True opens the linked page in a new window.

res1     Optional. Unused.

res2     Optional. Unused.

res3     Optional. Unused.

Version added

5.0

Remarks

If you don't need to pass any information for one or more optional arguments, from Microsoft Visual Basic or Visual Basic for Applications, do not pass a value. From C or C++, pass an empty variant.

Visio 4.5 provided an undocumented Hyperlink method for a Document object that had the following signature:

HRESULT FollowHyperlink[in] (BSTR Target, [in] BSTR Location);

Visio 5.0 and later still support this method but it has been renamed FollowHyperlink45:

HRESULT FollowHyperlink45[in] (BSTR Target, [in] BSTR Location);

Use of FollowHyperlink45 is discouraged, however—unless you are using version 4.5, use FollowHyperlink instead.

Example

This Microsoft Visual Basic for Applications (VBA) macro shows how to use the FollowHyperlink method to navigate to a site on the Internet and view the resulting Web page in a new browser window. It also shows how to navigate to the second page of the current document and to the first page of another document on your computer. Before running the macro, substitute the path and file name of a valid Visio document on your computer for <path\filename>.

Public Sub FollowHyperlink_Example()

    'Navigate to the Microsoft Web site and view the page in a new browser window.
    ThisDocument.FollowHyperlink "http://www.microsoft.com", "", , , 1
    
    'Navigate to the second page of the current document.
    ThisDocument.FollowHyperlink "", "Page-2"
    
    'Navigate to the first page of another document
    ThisDocument.FollowHyperlink "<path\filename>", "Page-1"

End Sub

Applies to | Document object

See Also | Address property | Frame property | NewWindow property | SubAddress property