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

Selecting a Graphic Behind a Text Box

How to select a graphic that is obscured by a text box can be perplexing. Here's an overview of the different ways you ...

Discover More

Merging Table Cells

Want to create cells that span multiple columns or multiple rows? You do this in Word by merging cells together. Here's ...

Discover More

Changing Your Windows 8 Account Picture

Want to personalize your Windows 8 experience a bit more? One way is by attaching a picture to your account, as discussed ...

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)

Associating a Name with a Position

Wouldn't it be great if Word allowed you to have a small pop-up that showed you some information associated with a ...

Discover More

Creating a Hyperlink that Opens the Linked Object

Hyperlinks can be very helpful for loading and displaying external resources. But they are less useful for opening and ...

Discover More

Controlling the Program Used with Hyperlinked Images

How to tell Windows which program to use for graphics with hyperlinks.

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 6 - 0?

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.