WD97: Saving as HTML Removes Hyperlink "Target" Tag

Last reviewed: July 31, 1997
Article ID: Q170720
The information in this article applies to:
  • Microsoft Word 97 for Windows

SYMPTOMS

In Microsoft Word, when you open and save an HTML document that contains hyperlinks, Word will strip out the optional "Target" tag and value if the document is saved from online layout view.

For example, the following hyperlink with the Target property

   <A HREF = "HTTP://WWW.MICROSOFT.COM/SUPPORT/" TARGET = "_TOP">Link
   Text</A>

will be saved in HTML as:

   <A HREF = "HTTP://WWW.MICROSOFT.COM/SUPPORT/">Link Text</A>

CAUSE

The Target tag allows a hyperlink to be opened in a specific frame. Because Microsoft Word 97 does not support HTML frames, Word will remove the TARGET= portion of the hyperlink text.

WORKAROUND

To retain the Target tag property, edit and save the document HTML Source view.

-or-

To preserve hyperlinks containing the target property, use the following steps before you edit the HTML document in online layout view in Microsoft Word 97.

Step 1: Change the Hyperlinks to Comments

a. Start Word 97, and open the HTML Document.

b. On the View menu, click HTML Source.

c. In HTML Source view, on the Edit menu, click Replace.

d. In the Find What box, type "<A HREF" (without the quotation marks).

e. In the Replace With box, type "<!-- <A HREF" (without the quotation

   marks).

f. Click Replace All.

g. In the Find What box, type "</A>" (without the quotation marks).

h. In the Replace With box, type "</A> -->" (without the quotation marks).

i. Click Replace All.

j. On the File menu, click Save.

k. Click the Exit HTML Source toolbar button.

Step 2: Make Your Changes in Online Layout View

Once you have changed the hyperlinks in your HTML document to comments, you can make changes to your HTML document in online layout. Once you have finished editing the HTML document, save the document and then follow the procedure in Step 3 to restore your hyperlinks.

When the hyperlinks are commented out, they will appear as hidden text. (To see hidden text, click the Show/Hide button on the Standard toolbar.)

Step 3: Restore the Hyperlinks

a. In Word 97, open your HTML Document.

b. On the View menu, click HTML Source.

c. In HTML Source view, on the Edit menu, click Replace.

d. In the Find What box, type "<!-- <A HREF" (without the quotation marks).

e. In the Replace With box, type "<A HREF" (without the quotation marks)

f. Click Replace All.

g. In the Find What box, type "</A> -->" (without the quotation marks).

h. In the Replace With box, type "</A>" (without the quotation marks).

i. Click Replace All.

j. On the File menu, click Save.

k. Click the Exit HTML Source toolbar button.

Following these steps will allow you to safely edit your html documents in Microsoft Word 97 while maintaining hyperlinks with the Target property.


Additional query words: 8.0 8.0 ia internet assistant
Keywords : winword word8 word97
Version : WINDOWS:97
Platform : WINDOWS
Issue type : kbprb
Solution Type : kbworkaround


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 31, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.