Answered by:

Unable to use relative object links in Word, Office 2010 SP1

Question

We and our customers are having the same problem. It seems to be impossible to insert objects using relative links (for example to .vsd visio files) in either .doc or .docx documents using Word 2010. We are using MS Office 2010 SP1.

Will relative object links will no longer supported by Microsoft Office?

I really hope You can point us to a workaround or solution, since it is so critical to be able to move a directory (without breaking links) which may happen so often for many reasons including archiving, system/infrastructure changes or just because
it is required to send documentation packages between working partners.

I have been working on the same issue. I have tried the information supplied but I can't seem to get the relative links to work at all when I am trying to link in Visio files. I have tried both setting the option for all word docs and
for just one. Any other suggestions?

This is a very helpful reply about absolute/relative hyperlinks, but actually, the question is about absolute or relative paths to linked objects. Eg, instead of insert picture from file, as an embedded image, to insert a link to an image file.

Please can someone at Microsoft confirm:

In Word 2010, can you insert a picture as a linked object, with a relative path?

In Word 2010, if you have an existing document which contains linked images and these have an absolute path, is there any way you can change these to relative paths? Ideally (most of our documents have 100~250 linked images), it would be
nice to change them all at once.

Possible avenues might include reverting to compatibility mode, or a macro. I can't work out how to do these myself, but maybe someone has some guidance for the poor users, who simply find functionality changed or ripped away as new versions are progressively
released.

My understanding is that all linked objects (OLE links) created in Office 2007/2010 documents that use Open XML formatting (DOCX, XLSX) will have "absolute" path links for OLE objects. This is really unfortunate as it does represent a significant behavior
change from previous versions of Office. I work for a software company that has consulted several times in-depth with Microsoft on this issue, and the best that they could suggest was some "macro code" that we could run when opening these documents,
which would in effect update the path to point to the correct new location of the document.

Here are a couple links that vaguely allude to this issue, but I have been unable to find definitive information from Microsoft detailing the technicalities of this change.

This thread is a bit old now, but I've hit this problem several times in the past, and finally found a solution (of sorts). I noticed that Word 2003 with compatibility extensions for docx
does create relative links, even when the document is saved in docx format. Word 2010 reads such documents without complaint. So I unpacked the .docx file (it's just a Zip file, after all) and looked for the place where the links are defined.
Turns out it's in:

word/_rels/document.xml.rels

I used a simple text editor to alter this file. Image links look a bit like this:

Notice the "file:///" prefix and the fact that the embedded absolute path uses "\" as its separator. Putting aside comments about the validity of such a URL, it's clearly an absolute locator. Word 2003 generates relative
paths, like this

So I used my global search/replace facility (with pattern matching) to change all these links, zipped the document up again, and voila: success!

Of course this is no use to those of you searching for a way to tell Word to do it right in the first place, but it demonstrates that the problem isn't in the docx representation, and it shows that an automated solution to fix existing documents could be
constructed.

Microsoft is conducting an online survey to understand your opinion of the Technet Web site. If you choose to participate, the online survey will be presented to you when you leave the Technet Web site.