Word changing hyperlinks from relative to absolute

R

Rob

Hi, I have a problem with Word 2007. When I insert relative hyperlinks in a
Word document to other files they keep changing from relative to absolute. I
think it happens when I select File|Save As. I now have a document with
hundreds of hyperlinks in it that will not work when the Word file and its
hyperlinked files are moved into a different folder. With the field codes
showing I have done a find and replace to remove the file path from the
hyperlink, but when I check the hyperlink edit window it still shows the
full path. Is there any way to change all these hyperlinks back to relative
and stop them changing again. Thanks, Rob
 
S

Suzanne S. Barnhill

This is a longstanding problem with Word. My experience is that the links
don't update when you save but when you reopen the file. If there's a
solution, I never found it.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org
 
M

macropod

Hi Rob,

Word's field links (hyperlink, includetext, includepicture, link, rd) always use absolute paths and that's what you're getting, not
relative paths. Even if you remove the path from the field code, it's still there in the document metacode. What you need for what
you've described is relative paths.

To see how to implement relative paths in Word, check out the solution I've posted at:
http://lounge.windowssecrets.com/index.php?showtopic=670027
 
R

Rob

Hi Suzanne and macropod. Thanks for the info. I have done a bit more
trial and error research myself and have the following findings:
1. The problem always happens on Save As, never on Save or on
reopening a file.
2. Unchecking the "update automatic links at open" has no effect
3. Unchecking "update links on save" inside Word Options | Advanced |
Web options | Files DOES stop the problem.

I can now insert a hyperlink, save as, close, open and the relative
hyperlink is intact. The field code does not contain a file path, nor
does the address in the Edit Hyperlink window.

So this may be part of the answer (at least until someone opens the
file on another computer). However, I am still left with hundreds of
hyperlinks in my document that have a filepath in the address in the
Edit Hyperlink window but not in the field code. Can anyone suggest a
fast way to remove these filepaths? macropod I'm sorry if that is what
you have already suggested with your link - after reading it I was
unsure.

Many thanks
Rob
 
M

macropod

Hi Rob,

If you press Alt-F9 to expose the field codes, you can use a Find/Replace operation to modify the file paths in the hyperlink
fields.

The solution in the link I referred to works by replacing the file path in the field with a filename field, plus some path
delimiters. Again, you could use a Find/Replace operation to replace the file paths in the hyperlink fields with the filename field
& path delimiters. To do this:
1. create a filename field and the path delimiters. To do this:
.. a. press Ctrl-F9 to create a pair of field braces (ie '{}')
.. b. type FILENAME \p between the field braces, thus '{FILENAME \p}'
.. c. add the path delimiters, so that you end up with '{FILENAME \p}\\..\\'
2. copy the filepath from a hyperlink field and paste it into the Find expression in the Find/Replace dialogue box, then do a 'Find'
3. cut the filename field and the path delimiters from the document
4. open the Find/Replace dialogue box and type '^c' into the Replace expression in the Find/Replace dialogue box
5. Click 'replace all'.

If you've got hyperlink fields without the file path, you'll need to add the filename field and the path delimiters to those fields.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top