Share via


Document.FollowHyperlink Method

Word Developer Reference

Displays a cached document, if it has already been downloaded. Otherwise, this method resolves the hyperlink, downloads the target document, and displays the document in the appropriate application.

Syntax

expression.FollowHyperlink(Address, SubAddress, NewWindow, AddHistory, ExtraInfo, Method, HeaderInfo)

expression   Required. A variable that represents a Document object.

Parameters

Name Required/Optional Data Type Description
Address Required String The address of the target document.
SubAddress Optional Variant The location within the target document. The default value is an empty string.
NewWindow Optional Variant True to display the target location in a new window. The default value is False.
AddHistory Optional Variant True to add the link to the current day's history folder.
ExtraInfo Optional Variant A string or a byte array that specifies additional information for HTTP to use to resolve the hyperlink. For example, you can use ExtraInfo to specify the coordinates of an image map, the contents of a form, or a FAT file name. The string is either posted or appended, depending on the value of Method. Use the ExtraInfoRequired property to determine whether extra information is required.
Method Optional Variant Specifies the way additional information for HTTP is handled. Can be any MsoExtraInfoMethod constant.
HeaderInfo Optional Variant A string that specifies header information for the HTTP request. The default value is an empty string.You can combine several header lines into a single string by using the following syntax: "string1" & vbCr & "string2". The specified string is automatically converted into ANSI characters. Note that the HeaderInfo argument may overwrite default HTTP header fields.

Example

This example follows the specified URL address and displays the Microsoft home page in a new window.

Visual Basic for Applications
  ActiveDocument.FollowHyperlink _
    Address:="http://www.Microsoft.com", _
    NewWindow:=True, AddHistory:=True

This example displays the HTML document named "Default.htm."

Visual Basic for Applications
  ActiveDocument.FollowHyperlink Address:="file:C:\Pages\Default.htm"

See Also