Discussion:
How do I use hyperlink base?
(too old to reply)
ChrisB
2006-03-30 08:54:01 UTC
Permalink
I want to use an environment variable as a htperlink base in Word and Excel.
For example a variable DOCUMENTS may be set as c:\mystuff\documents and then
a hyperlink would be relative to it in a document. If I use
c:\mystuff\documents as the hyperlink base it is fine, but I can't see how to
use the variable DOCUMENTS. %DOCUMENTS% doesn't seem to work.
John McGhie [MVP - Word and Word Macintosh]
2006-04-01 06:34:51 UTC
Permalink
Hi Chris:

The hyperlink base you set needs to be the complete path in Internet format
including the protocol identifier.

For hyperlink base to work, all the target documents need to be in the same
folder. You can't use a combination: it's either hyperlink base plus file
name (only), or you need the full explicit path and file name. You can't
have a hyperlink base + folder name + file name.

I suggest that what you "actually" want is NO hyperlink base. By default,
Word writes relative hyperlinks.

Cheers


On 30/3/06 6:54 PM, in article
Post by ChrisB
I want to use an environment variable as a htperlink base in Word and Excel.
For example a variable DOCUMENTS may be set as c:\mystuff\documents and then
a hyperlink would be relative to it in a document. If I use
c:\mystuff\documents as the hyperlink base it is fine, but I can't see how to
use the variable DOCUMENTS. %DOCUMENTS% doesn't seem to work.
--
Please reply to the newsgroup to maintain the thread. Please do not email
me unless I ask you to.

John McGhie <***@mcghie.name>
Microsoft MVP, Word and Word for Macintosh. Consultant Technical Writer
Sydney, Australia +61 (0) 4 1209 1410
ChrisB
2006-04-03 07:21:01 UTC
Permalink
Thanks,

However, setting no base adds a hyperlink ralative to my computer, it
inserts c:\etc ..., this will not be the same on other peoples machines.
Post by John McGhie [MVP - Word and Word Macintosh]
The hyperlink base you set needs to be the complete path in Internet format
including the protocol identifier.
For hyperlink base to work, all the target documents need to be in the same
folder. You can't use a combination: it's either hyperlink base plus file
name (only), or you need the full explicit path and file name. You can't
have a hyperlink base + folder name + file name.
I suggest that what you "actually" want is NO hyperlink base. By default,
Word writes relative hyperlinks.
Cheers
On 30/3/06 6:54 PM, in article
Post by ChrisB
I want to use an environment variable as a htperlink base in Word and Excel.
For example a variable DOCUMENTS may be set as c:\mystuff\documents and then
a hyperlink would be relative to it in a document. If I use
c:\mystuff\documents as the hyperlink base it is fine, but I can't see how to
use the variable DOCUMENTS. %DOCUMENTS% doesn't seem to work.
--
Please reply to the newsgroup to maintain the thread. Please do not email
me unless I ask you to.
Microsoft MVP, Word and Word for Macintosh. Consultant Technical Writer
Sydney, Australia +61 (0) 4 1209 1410
John McGhie [MVP - Word and Word Macintosh]
2006-04-04 10:47:43 UTC
Permalink
Once the hyperlinks are in the document, reveal your field codes, then use
Find/Replace to remove the path, leaving just the file name. Word won't put
it back in.

This technique requires that all the linked files be in the same folder as
the document.

Alternatively, save the document on the server before you add the
hyperlinks. That way, the links ought to be correct on anyone's computer.

cheers


On 3/4/06 5:21 PM, in article
Post by ChrisB
Thanks,
However, setting no base adds a hyperlink ralative to my computer, it
inserts c:\etc ..., this will not be the same on other peoples machines.
Post by John McGhie [MVP - Word and Word Macintosh]
The hyperlink base you set needs to be the complete path in Internet format
including the protocol identifier.
For hyperlink base to work, all the target documents need to be in the same
folder. You can't use a combination: it's either hyperlink base plus file
name (only), or you need the full explicit path and file name. You can't
have a hyperlink base + folder name + file name.
I suggest that what you "actually" want is NO hyperlink base. By default,
Word writes relative hyperlinks.
Cheers
On 30/3/06 6:54 PM, in article
Post by ChrisB
I want to use an environment variable as a htperlink base in Word and Excel.
For example a variable DOCUMENTS may be set as c:\mystuff\documents and then
a hyperlink would be relative to it in a document. If I use
c:\mystuff\documents as the hyperlink base it is fine, but I can't see how to
use the variable DOCUMENTS. %DOCUMENTS% doesn't seem to work.
--
Please reply to the newsgroup to maintain the thread. Please do not email
me unless I ask you to.
Microsoft MVP, Word and Word for Macintosh. Consultant Technical Writer
Sydney, Australia +61 (0) 4 1209 1410
--
Please reply to the newsgroup to maintain the thread. Please do not email
me unless I ask you to.

John McGhie <***@mcghie.name>
Microsoft MVP, Word and Word for Macintosh. Consultant Technical Writer
Sydney, Australia +61 (0) 4 1209 1410
ChrisB
2006-04-04 11:08:01 UTC
Permalink
Thanks I will try that. It seems to me that it would be much more useful for
Word, and all the other Office programmes to use environment variables as a
possible hyperlink base.
Post by John McGhie [MVP - Word and Word Macintosh]
Once the hyperlinks are in the document, reveal your field codes, then use
Find/Replace to remove the path, leaving just the file name. Word won't put
it back in.
This technique requires that all the linked files be in the same folder as
the document.
Alternatively, save the document on the server before you add the
hyperlinks. That way, the links ought to be correct on anyone's computer.
cheers
On 3/4/06 5:21 PM, in article
Post by ChrisB
Thanks,
However, setting no base adds a hyperlink ralative to my computer, it
inserts c:\etc ..., this will not be the same on other peoples machines.
Post by John McGhie [MVP - Word and Word Macintosh]
The hyperlink base you set needs to be the complete path in Internet format
including the protocol identifier.
For hyperlink base to work, all the target documents need to be in the same
folder. You can't use a combination: it's either hyperlink base plus file
name (only), or you need the full explicit path and file name. You can't
have a hyperlink base + folder name + file name.
I suggest that what you "actually" want is NO hyperlink base. By default,
Word writes relative hyperlinks.
Cheers
On 30/3/06 6:54 PM, in article
Post by ChrisB
I want to use an environment variable as a htperlink base in Word and Excel.
For example a variable DOCUMENTS may be set as c:\mystuff\documents and then
a hyperlink would be relative to it in a document. If I use
c:\mystuff\documents as the hyperlink base it is fine, but I can't see how to
use the variable DOCUMENTS. %DOCUMENTS% doesn't seem to work.
--
Please reply to the newsgroup to maintain the thread. Please do not email
me unless I ask you to.
Microsoft MVP, Word and Word for Macintosh. Consultant Technical Writer
Sydney, Australia +61 (0) 4 1209 1410
--
Please reply to the newsgroup to maintain the thread. Please do not email
me unless I ask you to.
Microsoft MVP, Word and Word for Macintosh. Consultant Technical Writer
Sydney, Australia +61 (0) 4 1209 1410
ChrisB
2006-04-04 11:19:02 UTC
Permalink
I have tried this. revealing the field codes does indeed show a relative
path. However if you hover over the link (or indeed use the link) it
resolves to an incorrect place.

I created a file in directory bert called fred.doc. At the same level there
is a folder ethel, this has another document inside. In fred I created a
hyperlink to the document in ethel. On someone elses machine, where the base
folder is called notbert, the hyperlink tried to load
c:\bert\ethel\thedocument (correct on my machine), rather than
c:\notbert\etthel\thedocument.
Post by John McGhie [MVP - Word and Word Macintosh]
Once the hyperlinks are in the document, reveal your field codes, then use
Find/Replace to remove the path, leaving just the file name. Word won't put
it back in.
This technique requires that all the linked files be in the same folder as
the document.
Alternatively, save the document on the server before you add the
hyperlinks. That way, the links ought to be correct on anyone's computer.
cheers
On 3/4/06 5:21 PM, in article
Post by ChrisB
Thanks,
However, setting no base adds a hyperlink ralative to my computer, it
inserts c:\etc ..., this will not be the same on other peoples machines.
Post by John McGhie [MVP - Word and Word Macintosh]
The hyperlink base you set needs to be the complete path in Internet format
including the protocol identifier.
For hyperlink base to work, all the target documents need to be in the same
folder. You can't use a combination: it's either hyperlink base plus file
name (only), or you need the full explicit path and file name. You can't
have a hyperlink base + folder name + file name.
I suggest that what you "actually" want is NO hyperlink base. By default,
Word writes relative hyperlinks.
Cheers
On 30/3/06 6:54 PM, in article
Post by ChrisB
I want to use an environment variable as a htperlink base in Word and Excel.
For example a variable DOCUMENTS may be set as c:\mystuff\documents and then
a hyperlink would be relative to it in a document. If I use
c:\mystuff\documents as the hyperlink base it is fine, but I can't see how to
use the variable DOCUMENTS. %DOCUMENTS% doesn't seem to work.
--
Please reply to the newsgroup to maintain the thread. Please do not email
me unless I ask you to.
Microsoft MVP, Word and Word for Macintosh. Consultant Technical Writer
Sydney, Australia +61 (0) 4 1209 1410
--
Please reply to the newsgroup to maintain the thread. Please do not email
me unless I ask you to.
Microsoft MVP, Word and Word for Macintosh. Consultant Technical Writer
Sydney, Australia +61 (0) 4 1209 1410
Suzanne S. Barnhill
2006-04-05 04:36:22 UTC
Permalink
You have to make two passes with Find/Replace, once for the display text and
once for the field code; see
http://sbarnhill.mvps.org/WordFAQs/HyperlinkProbs.htm
--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
Post by ChrisB
I have tried this. revealing the field codes does indeed show a relative
path. However if you hover over the link (or indeed use the link) it
resolves to an incorrect place.
I created a file in directory bert called fred.doc. At the same level there
is a folder ethel, this has another document inside. In fred I created a
hyperlink to the document in ethel. On someone elses machine, where the base
folder is called notbert, the hyperlink tried to load
c:\bert\ethel\thedocument (correct on my machine), rather than
c:\notbert\etthel\thedocument.
Post by John McGhie [MVP - Word and Word Macintosh]
Once the hyperlinks are in the document, reveal your field codes, then use
Find/Replace to remove the path, leaving just the file name. Word won't put
it back in.
This technique requires that all the linked files be in the same folder as
the document.
Alternatively, save the document on the server before you add the
hyperlinks. That way, the links ought to be correct on anyone's computer.
cheers
On 3/4/06 5:21 PM, in article
Post by ChrisB
Thanks,
However, setting no base adds a hyperlink ralative to my computer, it
inserts c:\etc ..., this will not be the same on other peoples machines.
Post by John McGhie [MVP - Word and Word Macintosh]
The hyperlink base you set needs to be the complete path in Internet format
including the protocol identifier.
For hyperlink base to work, all the target documents need to be in the same
folder. You can't use a combination: it's either hyperlink base plus file
name (only), or you need the full explicit path and file name. You can't
have a hyperlink base + folder name + file name.
I suggest that what you "actually" want is NO hyperlink base. By default,
Word writes relative hyperlinks.
Cheers
On 30/3/06 6:54 PM, in article
Post by ChrisB
I want to use an environment variable as a htperlink base in Word and Excel.
For example a variable DOCUMENTS may be set as c:\mystuff\documents and then
a hyperlink would be relative to it in a document. If I use
c:\mystuff\documents as the hyperlink base it is fine, but I can't
see how
Post by ChrisB
Post by John McGhie [MVP - Word and Word Macintosh]
Post by ChrisB
Post by John McGhie [MVP - Word and Word Macintosh]
Post by ChrisB
to
use the variable DOCUMENTS. %DOCUMENTS% doesn't seem to work.
--
Please reply to the newsgroup to maintain the thread. Please do not email
me unless I ask you to.
Microsoft MVP, Word and Word for Macintosh. Consultant Technical Writer
Sydney, Australia +61 (0) 4 1209 1410
--
Please reply to the newsgroup to maintain the thread. Please do not email
me unless I ask you to.
Microsoft MVP, Word and Word for Macintosh. Consultant Technical Writer
Sydney, Australia +61 (0) 4 1209 1410
Loading...