How to Create a Hyperlink to Another File

Hyperlinks are references to either a location within the same document, or to a different, external document. These external documents may be elsewhere on the same computer or on a different computer entirely. This article looks at how to make an hyperlink to an external file on a web page using HTML and by using a word processor.

Hands with laptop computer and printer
credit: Thinkstock Images/Comstock/Getty Images

Organization

Step

Find the file. If the destination file is in the same directory tree as the file containing our link, we will be able to use a "relative" link. If the file is on another computer, we will need to write out that location using the Uniform Resource Identifier (URI) syntax common to web browsers.

Step

Record the name and location of the file to you want linked in. In our examples, we will work with three files. File1.pdf will be located in the same directory as the file in which we're making the link. File2.pdf will be located in the /secondfile directory. File3.pdf will be on the web site null.org.

Step

Pick the text in your web page or document that you would like to use to represent the link. This text will be called the label for the link. In these examples the words "file1," "file2" and "file3" will be our labels.

Web Page Syntax

Step

Most web pages are written using HyperText Markup Language (HTML). To add a link to an HTML page, you identify the destination file first, and then list the word or words you want "linked" with that destination file.

Step

The HTML link syntax starts and ends with the Anchor element. The HyperText Reference (href) will indicate the name and location of the file, and the label for the link will be nested within greater and less-than signs.

Step

See how the href value can point to other machines as easily as it points to the working directory the file is currently in.file1file2file3

Step

Check your work against these examples: In my examplefile1 is in my current directory. In this examplefile2 is in a different directory on the same server. In this examplefile3 file3 is on the Internet server at null.org.

Using an Office Suite

Step

With popular word processing packages, the process is even easier. This example will use OpenOffice Writer as an example.

Step

Type out the text you want. Select the text you want to use as a label--whether by using the mouse or holding the shift key down as you move with the arrow keys.

Step

From the Insert menu, select "Hyperlink." A set of different icons appear on the left side of the Dialog box to help you add different types of hyperlinks. Select "Internet."

Step

In the Dialog box, add the path and file name at the top, and the label down below.

Step

Click "Apply" to make the change and "Close" to go back to composing your text.