Skip to content

Hash # web link problem in Word

Web links with the vital hash character aren’t always properly exported by Word 2007 or Word 2010.

Phil Y, currently touring Germany, has found a curious bug in Word 2007 and Word 2010. Web links in a Word document aren’t always exported correctly to PDF or XPS files.

We can’t find any mention of this in the Microsoft Knowledge Base even though the bug has existed for years and it’s hard to believe that Phil is the first person ever to notice it.

A web link can often include a hash # character to take you to a bookmark on that page. For example foobar.htm goes to the top of that page foobar.htm#chapter2 will jump to the ‘Chapter2’ bookmark on that page.

You can setup these links in Word and navigate to them by pressing the Ctrl key then clicking on the link in the document.

Phil noticed that when he exported a document to PDF format, the web links were sometimes ‘cut off’ at the hash # character. The hash character and anything after it is removed from the web link!

This isn’t an obscure problem – for example Picasa uses the # symbol to take you to a specific photo instead of the entire picture album. has done some investigation and isolated the bug a little.

  • The bug only seems to occur with web links attached to an image. The same link to plain text is unaffected when exported.

  • The bug isn’t PDF specific either. Export the document to Microsoft’s rival XPS format shows the same bug.

  • But if you save to another format, such as MHT, the web links are exported correctly.

So the bug seems to be in the code that exports PDF/XPS files.

The moral is to check all links in PDF/XPS generated by Word, especially any links ‘behind’ non text objects.

Two interim workarounds:

  • Put the web link in a caption instead of the image itself.

  • Setup a redirect link that takes a user from a Word compatible link to the real link. You’d need a web site to do this and is probably more trouble than it’s worth.

About this author