I'm working in a Dropbox folder on a word document. I'd like to insert a pdf object which will be updated by a script separately. The problem is that the linked object in Insert > Object > Create from File is specified by an absolute path C:\Hugh\Dropbox\figures\foo.pdf. When someone else edits the file, and I return to the file, the object is corrupted and the link broken.

I'd like specify the path by a relative path ..\figures\foo.pdf (my Word document is in \Dropbox\thedoc.docx. What's the best practice to do this? I've tried typing ..\figures\foo.pdf but that fails.

Even a solution that requires the figures and docx file to be colocated in the same directory would be acceptable.

  • 1
    Why don't you link to a universal location like HTTP or a network share with a UNC path that everyone can access? I'm thinking there's only one c:\Hugh\Dropbox location. – Sun Feb 11 '15 at 1:12
  • Using a http link to the dropbox location doesn't provide an error, but the image does not appear (just a placeholder with a red x in the corner). – Hugh Feb 11 '15 at 1:18
  • I don't think you can use Dropbox for hot linking. Try imgur and reference the direct URL. – Sun Feb 11 '15 at 1:58

The last post in this thread in a microsoft forum contains a possible approach. For the benefit of future readers I'll replicate the contents here.

Note: This approach doesn't appear to work with "Embedded Objects", but only with simple image files (see bottom of the answer for details).

Image Files :-)

First MAKE A BACKUP COPY OF YOUR WORD FILE. Then rename your .docx file to .zip (because it's just a zip file after all). Extract the zip file and open the file word/_rels/document.xml.rels with a text editor. You should find sections similar to the following:

      TargetMode="External" />

Just remove the path from the Target line for each entry: Target="foo.png"

Then save the file and zip the folder again (or copy just the modified file into the original zip file if your archive manager supports that). Rename the .zip file back to .docx and try to open it with Word. Hope it doesn't complain.

Embedded or Linked Objects :-(

Embedded or linked OLE objects are treated differently from linked image files. They are specified in the file word/document.xml using a different syntax. For example, an embedded Visio file might look like this:

<w:instrText xml:space="preserve"> LINK Visio.Drawing.11 "\\\\path\\to\\file.vsd" "" \a \p \f 0 \* MERGEFORMAT </w:instrText>

Unfortunately I've had no success shortening the path to just "file.vsd" or ".\\file.vsd" (the file is in the same directory as the Word document). Word complains that the document is corrupted when trying to open it. If you tell it to repair the document, it will remove the whole w:instrText block.

  • In word 2010 the resulting file is corrupted. – Jose Ospina Jul 31 '15 at 13:53

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.