Quick question on hyperlink base

User avatar
Rudi
gamma jay
Posts: 25398
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Quick question on hyperlink base

Post by Rudi »

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
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

User avatar
HansV
Administrator
Posts: 74423
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Quick question on hyperlink base

Post by HansV »

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".
Regards,
Hans

User avatar
Rudi
gamma jay
Posts: 25398
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: Quick question on hyperlink base

Post by Rudi »

Ah, that makes it absolutely clear. :grin:
TX.
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 13374
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Quick question on hyperlink base

Post by ChrisGreaves »

Rudi wrote:
14 Apr 2016, 18:44
Ah, that makes it absolutely clear. :grin:
TX.
Hi Rudi. Lucky for you, ***I*** am here to muddy the waters, relatively speaking!
Cheers
Chris
Four out of three people have trouble with Fractions

User avatar
Rudi
gamma jay
Posts: 25398
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: Quick question on hyperlink base

Post by Rudi »

I'm absolutely OK with you Turing this thread on its head, Chris. :grin:
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 13374
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Quick question on hyperlink base

Post by ChrisGreaves »

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".
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.
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
Four out of three people have trouble with Fractions

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 13374
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Quick question on hyperlink base

Post by ChrisGreaves »

HansV wrote:
14 Apr 2016, 18:36
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".
Word2003, as usual ...
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.
Libraries012.png
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.
Four out of three people have trouble with Fractions