Ask Your Question
0

Relative and absolute Hyperlinks

asked 2018-07-10 17:40:02 +0200

BobGlen gravatar image

updated 2018-07-12 17:47:06 +0200

erAck gravatar image

Hi If I need to go up one directory and then down two, the following formulae works in excel.
HYPERLINK(CONCATENATE("..\DB\SVNotes\",F17631,".PDF"),"DOC")

In Libre I seem to need to create an absolute path with the drive letter specified, this creates problems with portability from one PC or OS to another. How best in Libre to achieve the same relativity. I have specified Save URLS as relative to file system, but still the drive letter remains, it is not referencing the directory TOP but the Drive letter. Perhaps I have missed something critical, and have tried to research this but came up empty handed.

Have a beautiful day Bob

edit retag flag offensive close merge delete

Comments

1

A similar question was answered at https://ask.libreoffice.org/en/questi....

Jim K gravatar imageJim K ( 2018-07-10 20:47:16 +0200 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2018-07-10 20:27:43 +0200

Jim K gravatar image

updated 2018-07-10 20:47:11 +0200

Relative paths can be obtained by going to Insert -> Hyperlink. The full path is shown; however, it is in fact saved as relative because the file can be moved and it still works.

Sadly, this does not work with the HYPERLINK function. Only absolute paths are possible. A workaround is to include the path to the current document, as explained at https://forum.openoffice.org/en/forum.... For this formula to work, regular expressions must be enabled under Tools -> Options -> LibreOffice Calc -> Calculate.

=MID(CELL("filename");2;SEARCH("/[^/]+'#";CELL("filename"))-1)

More related links:

edit flag offensive delete link more

Comments

Note that for URIs you have to use / forward slashes instead of \ backslash, independent of OS. Also, as this uses regular expressions it won't work in Excel and other formula expressions / functions in your document that understand either wildcards or regular expressions will be affected as well by the Tools Options setting.

erAck gravatar imageerAck ( 2018-07-10 21:54:59 +0200 )edit
2

As a side note, the next version 6.2 may support relative references as URI references when clicking a HYPERLINK() result.

erAck gravatar imageerAck ( 2018-07-12 17:44:59 +0200 )edit

Thank You... Trust Villeroy, a Knight of the GNU Office Round table. One day we need to gather all his notes into a book. Look forward to 6.2. Have a beautiful day Bob

BobGlen gravatar imageBobGlen ( 2018-07-15 18:41:55 +0200 )edit

If this answer was helpful, then please click the check mark. See guidelines for asking.

Jim K gravatar imageJim K ( 2018-07-16 16:57:31 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2018-07-10 17:40:02 +0200

Seen: 30 times

Last updated: Jul 10