FollowHyperlink Method

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

                 

The FollowHyperlink method opens the document or Web page specified by a hyperlink address.

Syntax

[application.]FollowHyperlinkaddress, [subaddress], [newwindow], [addhistory], [extrainfo], [method], [headerinfo]

The FollowHyperlink method has the following arguments.

Argument Description
application The Application object.
address A string expression that evaluates to a valid hyperlink address.
subaddress A string expression that evaluates to a named location in the document specified by the address argument. The default is a zero-length string (" ").
newwindow A Boolean value where True (1) opens the document in a new window and False (0) opens the document in the current window. The default is False.
addhistory A Boolean value where True adds the hyperlink to the History folder and False doesn't add the hyperlink to the History folder. The default is True.
extrainfo A string or an array of Byte data that specifies additional information for navigating to a hyperlink. For example, this argument may be used to specify a search parameter for an .asp or .idc file. In your Web browser, the extrainfo argument may appear after the hyperlink address, separated from the address by a question mark (?). You don't need to include the question mark when you specify the extrainfo argument.
method An Integer value that specifies how the extrainfo argument is attached. The method argument may be one of the following intrinsic constants.
  Constant Description
  msoMethodGet The extrainfo argument is appended to the hyperlink address and can only be a string. This value is passed by default.
  msoMethodPost The extrainfo argument is posted, either as a string or as an array of type Byte.
headerinfo A string that specifies header information. By default the headerinfo argument is a zero-length string.

Remarks

By using the FollowHyperlink method, you can follow a hyperlink that doesn't exist in a control. This hyperlink may be supplied by you or by the user. For example, you can prompt a user to enter a hyperlink address in a dialog box, then use the FollowHyperlink method to follow that hyperlink.

You can use the extrainfo and method arguments to supply additional information when navigating to a hyperlink. For example, you can supply parameters to a search engine. To search the Yahoo site for information on Microsoft, you might call the FollowHyperlink method as follows:

Application.FollowHyperlink "http://search.yahoo.com/bin/search", _
    , , , "p=Microsoft", msoMethodGet

You can use the Follow method to follow a hyperlink associated with a control.