Keeping a Document Open After Hyperlinking

Written by Allen Wyatt (last updated May 1, 2021)
This tip applies to Word 97 and 2000


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. ...

MORE FROM ALLEN

Adding Information after the Endnotes

Endnotes appear at the end of the document, right? Not always, as Word provides a way that you can actually add as much ...

Discover More

Hiding and Unhiding Worksheets

Worksheets are easily accessible in a workbook, but you may not want them to be so open. You can hide worksheets so they ...

Discover More

Finding Information in the Registry

The Registry is the central depository of configuration information used by Windows and by programs running on your ...

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!

More WordTips (menu)

Adding a ScreenTip

Need to add a ScreenTip to your document? It's easy to do, provided you are adding a hyperlink.

Discover More

ScreenTips without Hyperlinks

ScreenTips can be a helpful feature in some documents, but adding them also means you need to add a hyperlink. Here's a ...

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
Subscribe

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

View most recent newsletter.

Comments

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 1 + 1?

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.

Videos
Subscribe

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.