Absolute hyperlink path

C

Carl L Cooper

In creating a hyperlink between two Word documents, how can I force Word to
insert an absolute path when I click the ³Select² box? The default seems to
be a relative path. And the relative path doesn¹t work because ³Desktop²
always seems to be inserted into the path.

Unchecking the ³Update links on save² box in Word¹s Preferences didn¹t solve
the problem.

Thanks,

Carl L Cooper
 
J

John McGhie

Which version of Word? Which OS?


In creating a hyperlink between two Word documents, how can I force Word to
insert an absolute path when I click the ³Select² box? The default seems to
be a relative path. And the relative path doesn¹t work because ³Desktop²
always seems to be inserted into the path.

Unchecking the ³Update links on save² box in Word¹s Preferences didn¹t solve
the problem.

Thanks,

Carl L Cooper

--
Don't wait for your answer, click here: http://www.word.mvps.org/

Please reply in the group. Please do NOT email me unless I ask you to.

John McGhie, Microsoft MVP, Word and Word:Mac
Sydney, Australia. mailto:[email protected]
 
J

John McGhie

Thanks Carl:

OK, the mechanism is not "ideal" in 2008 :)

If you SAVE the document before inserting the hyperlinks, the Hyperlink will
be a relative link to the location of the saved document.

If you have NOT saved the document, the hyperlink will be an explicit path.

However, in each case, if you hover over the hyperlink, you will see that
the URI resolves to an explicit path name.

For example: Here's a path to a document on my local machine:
"file://localhost/Users/john/Documents/Chunqing/Chunqing%20Pan%20Resume.doc"

Here's a path to the same document backed up on the PC elsewhere on my
network:
"file://localhost/Volumes/MCGHIEHOME%3BDELL670/Chunqing/
Chunqing%20Pan%20Resume.doc"

If I save the document in the same folder as the target, this is what I get:
"Chunqing%20Pan%20Resume.doc"

If I save the document on the PC and link to a document on the Mac, I get:
"file://localhost/Users/john/Documents/Chunqing/
Chunqing%20Pan%20Resume.doc"

In each case, these are the raw URIs that were returned from the file
system.

The only way to get resolvable URIs is to first save both the file and the
target documents to a web server whose URL your NS can resolve.

Hope this helps


Sorry, John. I should have furnished this info when I posted the question:

--
Don't wait for your answer, click here: http://www.word.mvps.org/

Please reply in the group. Please do NOT email me unless I ask you to.

John McGhie, Microsoft MVP, Word and Word:Mac
Sydney, Australia. mailto:[email protected]
 
C

Carl L Cooper

On my machine, regardless of whether I have saved the document or not, I get
a defective link. The reason becomes clear when I hover over it; invariably
³Desktop² has been inserted into the path, thus rendering the path
incorrect.

Am I missing something about ³same folder²? I¹m linking Word documents on
the same computer, but I¹ve never thought about whether they are in the same
or different folders.

Or could it have something to do with the fact that most of my Word
documents are in Compatibility Mode?

Thanks,

Carl
 
J

John McGhie

Hi Carl:

Well, you need to know where those documents are...

Word stores the absolute path to the file as returned by your computer.
Right-click the hyperlink and choose "Toggle Field Codes" to see what it's
actually writing.

But if your documents are inside the "Desktop" folder, the word "Desktop"
will indeed appear in the path.

The fully-qualified pathname the system returns looks into the storage
system from the root of the hard disk.

Cheers


On my machine, regardless of whether I have saved the document or not, I get
a defective link. The reason becomes clear when I hover over it; invariably
³Desktop² has been inserted into the path, thus rendering the path
incorrect.

Am I missing something about ³same folder²? I¹m linking Word documents on
the same computer, but I¹ve never thought about whether they are in the same
or different folders.

Or could it have something to do with the fact that most of my Word
documents are in Compatibility Mode?

Thanks,

Carl

--
Don't wait for your answer, click here: http://www.word.mvps.org/

Please reply in the group. Please do NOT email me unless I ask you to.

John McGhie, Microsoft MVP, Word and Word:Mac
Sydney, Australia. mailto:[email protected]
 
C

Carl L Cooper

If the two documents are in the same folder, John, this works fine; but if
the two documents are in different folders, the link gets corrupted by the
insertion of ³Desktop² or some other folder. I misspoke when I said that
³Desktop² was invariably inserted into the path. (Many of my files are on
the Desktop.) What I should have said is that the name of the folder in
which the file where I¹m creating the hyperlink resides gets inserted into
the path and corrupts it.

Let me give an example. Here¹s an actual hierarchy on my computer:
Documents folder > Culture folder > ³Books² file

Documents folder > Health folder > ³Dr. Piros² file

I want to create a hyperlink in the ³Books² file, which is in the Culture
folder, that will jump me to the ³Dr. Piros² file, which is in a different
folder (Health). The correct link would be:
file://localhost/Users/carlcooper/Documents/Health/Dr.%20Piros

But the link which is created is:
file://localhost/Users/carlcooper/Documents/Culture/Health/Dr.%20Piros

The link of course won¹t work because ³Culture² has been inserted.

Thanks, John.

Carl
 
J

John McGhie

Hi Carl:

Hah!! Got it... Sorry about that... I can now reproduce it here and I
will report it as a bug.

You are quite correct: Word 2008 Version 12.1.5 build 081119 indeed has a
bug in the hyperlink mechanism. It depends on how you insert the hyperlink,
which is why I did not see the bug when I first tested it.

The bug is:

1) Document in Folder A

2) Target in Folder B

Both folders within the User/Documents folder, so three layers down from the
root.

If you link to another document in Folder A, you get an unqualified pathname
which will resolve correctly.

If you link to a document in Folder B, Word 2008 is concatenating the name
of the CONTAINING folder (Folder A in the example) before the name of the
TARGET folder (Folder B) and thus breaking the hyperlink.

I was being lazy. If when you hit Command + K you then drop down the list
at the end of the "Link to:" box, you get a list of old documents that have
previously been opened on the computer. If you choose one of those, the
hyperlink will be correct.

I will report that as a bug.

In the meantime, you can right-click the hyperlink field and reveal its raw
code. If you do that, you can manually correct the hyperlink.

If you THEN toggle the field codes back again, then right-click the field
again and choose "Update Field", it will work.

Not good...

Cheers



If the two documents are in the same folder, John, this works fine; but if
the two documents are in different folders, the link gets corrupted by the
insertion of ³Desktop² or some other folder. I misspoke when I said that
³Desktop² was invariably inserted into the path. (Many of my files are on
the Desktop.) What I should have said is that the name of the folder in
which the file where I¹m creating the hyperlink resides gets inserted into
the path and corrupts it.

Let me give an example. Here¹s an actual hierarchy on my computer:


I want to create a hyperlink in the ³Books² file, which is in the Culture
folder, that will jump me to the ³Dr. Piros² file, which is in a different
folder (Health). The correct link would be:


But the link which is created is:


The link of course won¹t work because ³Culture² has been inserted.

Thanks, John.

Carl
"file://localhost/Users/john/Documents/Chunqing/Chunqing%20Pan%20Resume.doc>>>>
"

--
Don't wait for your answer, click here: http://www.word.mvps.org/

Please reply in the group. Please do NOT email me unless I ask you to.

John McGhie, Microsoft MVP, Word and Word:Mac
Sydney, Australia. mailto:[email protected]
 
C

Carl L Cooper

Thanks, John, for charting the territory and identifying the bug in the
hyperlink mechanism. I really appreciate it.

In the meantime, as you indicated, there are various painless ways to get
the correct path into the ³Link to² box. Another technique I¹m using is to
put an ³x² in the ³Hyperlink base² box in Properties > Summary. That seems
to force Word to use the correct absolute address in the ³Link to² box.

Carl
 
J

John McGhie

Hi Carl:

You're welcome. Thanks for your persistence, and sorry it took me so long
to get to it.

I suggest great caution in using the "Hyperlink Base" field. It has some
inexplicable side-effects.

It adds a string that Word will pre-pend to the URL when it resolves it. If
you save those documents out as HTML, you may get a re-broken URL again.

Cheers


Thanks, John, for charting the territory and identifying the bug in the
hyperlink mechanism. I really appreciate it.

In the meantime, as you indicated, there are various painless ways to get
the correct path into the ³Link to² box. Another technique I¹m using is to
put an ³x² in the ³Hyperlink base² box in Properties > Summary. That seems
to force Word to use the correct absolute address in the ³Link to² box.

Carl


"file://localhost/Users/john/Documents/Chunqing/Chunqing%20Pan%20Resume.doc>>>>

--
Don't wait for your answer, click here: http://www.word.mvps.org/

Please reply in the group. Please do NOT email me unless I ask you to.

John McGhie, Microsoft MVP, Word and Word:Mac
Sydney, Australia. mailto:[email protected]
 

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