Fixing relative and absolute links in Word, Microsoft Office 2013, Office 2016, Office 2019
Last updated: Jan 24, 2023
This article explains how to replace absolute hyperlink references with relative ones, which makes your Microsoft Word document and linked files portable. So when you send them to a different computer, clicking on the hyperlink will open the file that you shipped with the Word document and not try to open the file that is on the computer where you wrote the document.
Say you are writing a final report for a survey and you have a link to the original contract, which is in a folder in the same directory as your report.You burn the Word document and the folder with the contract file on to a DVD and send it to out to the survey’s project manager. Then the project manager complains that the link doesn’t work. Instead of trying to open the file on the DVD, the link is trying to open the file that is on the computer that you wrote the Word report on.
We need to make sure that the links are ‘relative’, meaning relative to where the Word file is, not ‘absolute’, meaning where the original file was. In Office 2010 this was relatively straight forwards. With Office 2013 and newer versions, it is not.
To prevent this issue happening in the first place there is an option to set in Word, hidden under a sub menu of a sub menu:
- Select “File > Options”
- Select “Advanced”
- Scroll down to “General” and select “Web Options”
- Select the Files tab
This is great if you are in sole control of the document. But as soon as somebody else edits the file without this option being set correctly, you will inherit a Word file with hyperlinks pointing all over the place. Time to edit the underlying field codes.
The commands we are going to use are:
alt-f9 - this shows all of the hyperlinks as field codes. It toggles.
ctrl-f9 - click on a hyperlink and use this shortcut to toggle a single hyperlink to being the field code.
A field code for a hyperlink will have curly brackets and the word HYPERLINK . For example, under your nice blue underlined link called ‘8.16 Water bottom Horizon’, using alt-f9 you might see something like:
This is a nicely formed relative hyperlink. However, if you start to see unpleasantness like:
You have an absolute link, which will try to open a file on
which is unfortunate as this is a server on a survey ship and not accessible by your system unless you are on that ship. We need to use Word’s search and replace function to get rid of the bumf at the start.
<intentionally left blank>
One more search and replace should be done. For whatever reason, we need to replace all ‘\’ with ‘/’.
The information in this post should help you to get your links working correctly in your Microsoft Word documents in Office 2013. I am required to use Microsoft products at work. I find Life is Simpler with Linux. This is a topic for a different post.