6

Good afternoon!

I have inserted a hyperlink into an MS Word document, but I'd like to add an anchor tag to it so the link will go to a specific part of the page. The page it's linking is an HTML file, not a website, so it uses a "file://" type path.

If I set the hyperlink to document.html#header1, it simply parses out the #header1 and goes to the top of the document. I found this page:

http://www.pcreview.co.uk/forums/getting-hyperlink-tag-word-go-named-anchor-web-page-t3709855.html

But it applies to Word 97 and the dialogue doesn't work in Word 2013. Further searches only yielded blogs teaching people how to make hyperlinks in word (none deep enough to touch on anchor tags)

Does anyone have any tips or suggestions?

6
  • Appears to be broken to me.
    – Geoff
    May 16, 2013 at 19:06
  • I think this has always been broken and never fixed by MS. I don't know about that article, but I'm not too sure anchors worked properly with Word 97 either. Really strange, considering a plain old program like Wordpad is able to get it right. What's up with the Office team anyway? (Unless we're all missing something?)
    – Karan
    May 16, 2013 at 20:31
  • Try using URL encoding to change document.html#header1 into document.html%23header1.
    – martineau
    May 16, 2013 at 20:50
  • @martineau - Tried that at my end, also fails.
    – Geoff
    May 16, 2013 at 20:56
  • @Geoff: It was just a guess. I don't have Word 2013, but # works in Word 2003. It might be illuminating for you to import the document into your version and, if it works, see how it's doing it.
    – martineau
    May 16, 2013 at 21:04

5 Answers 5

4

I believe this might be of help to some people so i said id post it: I had the same problem with Word and as a work around i used a URL Encoder Do a quick search for one there's plenty such as here :

http://www.w3schools.com/tags/ref_urlencode.asp

Simply paste the url ,it will give back the Url that will work in a hyperlink from Word Excel etc.

3
  • Don't ask for votes in your answer. If your answer is a good one it will will be voted up anyway.
    – DavidPostill
    Sep 21, 2015 at 17:08
  • I don't really understand why this fixes the problem, but it does!
    – David
    Sep 14, 2017 at 19:43
  • Hmmm, this seemed to have a strange effect: when I closed and re-opened the document, it had changed the URL and prepended the file:// location of the Word document. Maybe this doesn't work after all.
    – David
    Sep 25, 2017 at 20:54
0

This is not a great answer, but right-clicking, copying the URL, and pasting into a browser works for me. Ctrl+Clicking the link does not. Pretty odd.

0

This is not a browser problem. MS Office applications are mangling URLs with a # being replaced with ' - ' (the %20 is a space).

This annoying problem is admitted to exist by Microsoft themselves. To quote from that page:

These problems may occur when the name of file to which you create the hyperlink contains a pound sign (#).

NOTE: The pound sign is a valid character to use in a file name but is not accepted in hyperlinks in Office documents.

Their only workarounds are to remove the offending # or to copy and paste the URL from the document ... utterly ridiculous considering the reason most people would be using the # is to make it easier for users to find content.

Request that Microsoft improve this behavior by voting here: https://office365.uservoice.com/forums/264636-general/suggestions/32273917-stop-mangling-urls-containing-a-so-we-can-link-t

0

I think I found a solution for MS Word 2010 and IE 11 on Windows 7. It might not work for everyone, but for me, it helped. What happened to me: I have a similar issue when I click the link from MS Word or Excel document when the link contains # symbol. # was replaced to %20-%20 and link did not work. For other links it was fine. Also if I edit link it shows the correct link with # symbol. If I send this Word document to another computer, it works fine.

My investigation results:

The root cause (as I understand):

By defult on some computers this registry key does not exist HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\Shell\Associations\URLAssociations(http|https)\UserChoice.

Solution:

If I change the default browser to Google Chrome and then change it back to IE 11, then it starts working. By changing the default browser to Chrome we force windows to create missing registry key (HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\Shell\Associations\URLAssociations(http|https)\UserChoice). Maybe if this registry key will be created manually, it will solve the problem as well, but I did not try it.

-1

Here is what worked for me: In IE under the advanced settings tab, make sure you have enabled "Send UTF-8 query strings". There are options for intranet URL's and non-intranet URL's. My issue was strictly Intranet, so that's all I enabled and tested. Hope that helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.