Keeping a Document Open After Hyperlinking

by Allen Wyatt
(last updated May 1, 2021)

If you use Word 97 or Word 2000, you can create hyperlinks in your documents. These links can be to either Internet resources or to other documents to which you have access. As documented in other WordTips issues, you create hyperlinks by using the Insert Hyperlink tool on the toolbar.

There can be a problem with hyperlinks, however. Subscriber Robin McLeod wrote to describe a problem that popped up with hyperlinks. If the hyperlink was to an Excel workbook, the workbook would open and then the Word document that contained the hyperlink would close. (Word would remain open, but the document itself would close.) Other subscribers wrote to say that they had observed the same behavior on their systems. It seems that this behavior is only present in Word 97, and not in Word 2000.

Actually, the behavior is a little more odd than what is described here. In reality, Word 97 closes the document if its "dirty" flag is not set. In other words, if there are no unsaved changes in the document, then it closes. If the document has been changed and not saved, then the document remains open after clicking on the hyperlink.

The solution to this problem is in the way in which the hyperlink itself is put together. Let's say you were linking to an Excel workbook called MyWorkbook. If you took a look at the field that created the hyperlink, it would look like the following. (You can look at the field code by positioning the insertion point just to the left of the hyperlink and then pressing Shift+F9.)

{ HYPERLINK "MyWorkbook.xls" }

When you click on this link, Word tries to load the target of the link into the current document window. In order to do that, it closes the current document. When it figures out that the target is an Excel workbook, it opens Excel, but the original Word document is still closed. (This behavior is sort of like moving from one Web page to another. When you click on a hyperlink, the old Web page is discarded and the new one is loaded.)

What you need to do is modify the hyperlink field so it looks like this:

{ HYPERLINK "MyWorkbook.xls" \n }

The \n switch causes Word to open the hyperlink target in a new window. Again, this is sort of like the "Open in New Window" command open on several different Web browsers. Word dutifully leaves the original document open (whether it has been saved or not) and opens the target in its own window.

Again, this "fix" is only necessary in Word 97. In Word 2000 the target of the hyperlink is always opened in a new window, and the original document remains open. Thus, it would appear that there is no real need for the \n switch for the hyperlink field in Word 2000.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (1421) applies to Microsoft Word 97 and 2000.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...


Debugging a Macro

Part of writing macros is to make sure they work as you expect. This involves a process known as debugging. Here's how ...

Discover More

Renaming a Style

Styles are invaluable when it comes to applying consistent formatting in and across documents. If you need to rename a ...

Discover More

Positioning Headers and Footers

Headers and footers can add a finishing touch to your printed documents. Here's how you can position those headers and ...

Discover More

Learning Made Easy! Quickly teach yourself how to format, publish, and share your content using Word 2013. With Step by Step, you set the pace, building and practicing the skills you need, just when you need them! Check out Microsoft Word 2013 Step by Step today!

More WordTips (menu)

Getting Rid of the Ctrl+Click Message

When you add a hyperlink to a document, you can later click that link to display whatever is linked to. Beginning in Word ...

Discover More

Closing Documents after a Hyperlink

When you click a hyperlink that takes you to another document, Word dutifully opens the new document in its own window. ...

Discover More

Stopping Word from Accessing the Internet

When you start Word, does it try to access the Internet? It may, depending on how your version of Word is configured. If ...

Discover More

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.


If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is four more than 8?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)

This Site

Got a version of Word that uses the menu interface (Word 97, Word 2000, Word 2002, or Word 2003)? This site is for you! If you use a later version of Word, visit our WordTips site focusing on the ribbon interface.


FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.