Hyperlinks

Office programs use the standard A element and its attributes to save hyperlinks to HTML.

Word converts the HYPERLINK field to an HTML hyperlink and bookmarks to named anchor <a name=> tags.

Excel stores hyperlinks as a format stored per range of cells or as an Excel formula. Excel saves both types of hyperlinks as HTML using a standard A element with an href attribute and it saves the formula separately. For more information about how Excel saves formulas to HTML, see the Excel Formulas and Data Types topic. For hyperlinks to a specific range of cells on the worksheet, Excel uses the <a name=> tag to identify the named cell range.

PowerPoint primarily uses VML to save presentations to HTML but it does use the A element for hyperlinks. For more information, see the PowerPoint topics.

Overlapping Bookmarks

In Word, it is possible to have overlapping bookmarks. Word saves these bookmarks to HTML using the A element, but nesting this element results in misinterpreted HTML since the browser assumes the </a> tag closes the previous <a name=> tag. Word uses the mso-bookmark style attribute to identify bookmarks that continue around nested bookmarks. The following example shows Word HTML output where bookmark1 spans the paragraph but bookmark2 only spans the second sentence in the paragraph.

<a name=bookmark1>Bookmark 1 starts here and continues 
to the end of this paragraph.</a>
<a name=bookmark2><span style='mso-bookmark:bookmark1'>Bookmark 2 starts here 
but ends at the end of this sentence.</span></a>
<span style='mso-bookmark:bookmark1'> Bookmark 1 continues 
to the end of this paragraph.</span>