Hyperlinks in office applications are by default relative, truncating the path to remove the part at the point where the host document is located. In order to force the document to maintain the full path (and make the link absolute), one can access File > Properties and in the File Tab, change the Hyperlink Base to store the part of the path that remains static.
Now for my question: I have seen advice provided in pages I search where it is mentioned to simply type an 'x' in the textbox. Why an 'x'? What does it represent? I assume its representative of a drive letter, or is it just to clear the text box from being blank (which if blank, instructs the app to use relative links.)
Some insight will be appreciated.
TX
Quick question on hyperlink base
-
- gamma jay
- Posts: 25455
- Joined: 17 Mar 2010, 17:33
- Location: Cape Town
Quick question on hyperlink base
Regards,
Rudi
If your absence does not affect them, your presence didn't matter.
Rudi
If your absence does not affect them, your presence didn't matter.
-
- Administrator
- Posts: 78524
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Quick question on hyperlink base
I think it works as follows:
- If the Hyperlink Base property is blank, hyperlinks will be relative to the folder that contains the document.
- If the Hyperlink Base property contains a valid path, hyperlinks will be relative to that path.
- If the Hyperlink Base property contains a string that doesn't correspond to a valid path, hyperlinks cannot be relative, so you force the application to treat them as absolute. A "w" or "xyz" would work just as well as an "x".
Best wishes,
Hans
Hans
-
- gamma jay
- Posts: 25455
- Joined: 17 Mar 2010, 17:33
- Location: Cape Town
Re: Quick question on hyperlink base
Ah, that makes it absolutely clear.
TX.
TX.
Regards,
Rudi
If your absence does not affect them, your presence didn't matter.
Rudi
If your absence does not affect them, your presence didn't matter.
-
- PlutoniumLounger
- Posts: 15636
- Joined: 24 Jan 2010, 23:23
- Location: brings.slot.perky
Re: Quick question on hyperlink base
There's nothing heavier than an empty water bottle
-
- gamma jay
- Posts: 25455
- Joined: 17 Mar 2010, 17:33
- Location: Cape Town
Re: Quick question on hyperlink base
I'm absolutely OK with you Turing this thread on its head, Chris.
Regards,
Rudi
If your absence does not affect them, your presence didn't matter.
Rudi
If your absence does not affect them, your presence didn't matter.
-
- PlutoniumLounger
- Posts: 15636
- Joined: 24 Jan 2010, 23:23
- Location: brings.slot.perky
Re: Quick question on hyperlink base
This being so, there is an opportunity here for an application that runs against (a) all documents in a path or (b) a single ("active") document.HansV wrote: ↑14 Apr 2016, 18:36
- If the Hyperlink Base property is blank, hyperlinks will be relative to the folder that contains the document.
- If the Hyperlink Base property contains a valid path, hyperlinks will be relative to that path.
- If the Hyperlink Base property contains a string that doesn't correspond to a valid path, hyperlinks cannot be relative, so you force the application to treat them as absolute. A "w" or "xyz" would work just as well as an "x".
The application could do one of three things:-
(1) Force the hyperlink base to be absolute (that is, load it with "?" or "*" or similar)
(2) Force the hyperlink base to be relative (that is, load it with the ActiveDocument.Path)
(3) Toggle the current setting.
I suggest this because from time to time I am working with a set of documents, and might maintain absolute addressing during development, but want to switch to relative addressing when it is time to export the suite of documents. Sometimes the suite is just "documentation", but at other times the suite is a set of (in the current case) Turing Machine tables.
Cheers
Chris
There's nothing heavier than an empty water bottle
-
- PlutoniumLounger
- Posts: 15636
- Joined: 24 Jan 2010, 23:23
- Location: brings.slot.perky
Re: Quick question on hyperlink base
Word2003, as usual ...HansV wrote: ↑14 Apr 2016, 18:36I think it works as follows:
- If the Hyperlink Base property is blank, hyperlinks will be relative to the folder that contains the document.
- If the Hyperlink Base property contains a valid path, hyperlinks will be relative to that path.
- If the Hyperlink Base property contains a string that doesn't correspond to a valid path, hyperlinks cannot be relative, so you force the application to treat them as absolute. A "w" or "xyz" would work just as well as an "x".
If you-all are brave, setup and then run the macro Cycling. (attached document)
If you-all are strapped for time, run the self-testing function CyclingHyperlinkAdd. That macro generates two absolute paths. I anticipated one absolute path and one relative path.
My theory (developed elsewhere) is that the File, Properties, Hyperlink Base applies to some internal VBE cover code that drives the Hyperlinks.Add code, and so, to program Hyperlinks.Add in VBA the programmer must interrogate the File, Properties, Hyperlink Base and create the Absolute or the Relative path within the VBA code. Or alternatively, create one's own UserForm with meaningful options.
Cheers, Chris
You do not have the required permissions to view the files attached to this post.
There's nothing heavier than an empty water bottle