# How to view 'full path' of open document?

Is there a way one can view/check the complete path of a document that's currently open in LO? — i.e., e.g., if you don’t remember the drive or directory you opened it from?

Is there a ‘preference’ to have the ‘full path’ displayed with the document name (at the top of the screen)?

Thanks.

edit retag close merge delete

Sort by » oldest newest most voted

The very first item in the 'Standard' toolbar, named 'Load URL' will show the full path-name (if not a new 'Untitled' document is active). You may have to "check" it customising the toolbar if the control doesn't show.

Editing:

How to customise the toolbar is described in more detail in the second comment below.

Being back to the thread due to a recent comment on my answer, I visited the bug mentioned by @m.a.riosv and decided to write a little macro offering a workaround for the purpose:

Sub showFileLocationInTitleBar()
u = ThisComponent.URL
If u = "" Then Exit Sub REM The document was not yet stored.
uWithoutProto = Split(u, "file://")(1)
ThisComponent.Title = uWithoutProto
End Sub


(I didn't thoroughly check for every possible issue with the code.)

I just assigned the above macro for my own LibreOffice to the Activate Document event via >Tools>Customize and saved the setting for all LibreOffice. It works for me as expected, and I consider to work permanently with it.
However, I cannot check with different OS, and I don't work in an environment with any specialties.
[Edit time=2020-08-31 about 19:10 UTC]After some additional considerations, and rgearding specific effects occurring during the debugging of any Basic code, I would dissuade from assigning the macro to Activate document. I assigned it instead to View created and to Document has been saved as as well. So far this works as I like it.[/Edit]

If you also want to give the workaround a try on your system, and you want to get the location shown regarding its path conventions, you may use the variant:

Sub showFileLocationInTitleBarSystemStyle()
u = ThisComponent.URL
If u = "" Then Exit Sub REM The document was not yet stored.
ThisComponent.Title = ConvertFromUrl(u)
End Sub

more

Not sure we're talking about the same thing. Nothing to do with URLs, just document names (& paths).

But if we are:

Please specify the actual steps to take. I don't see anything about 'Standard' toolbar or 'Load URL' in the toolbar area or in any dropdown menu. Thanks.

( 2015-01-02 01:49:09 +0200 )edit
1

A local file location is equivalent to an URL in this context and therefore the control is short-named 'Load URL'. It will nonetheless also show the full path-name of a local file under work.

Do you know how to customise the toolbars?

'View' > 'Toolbars' > 'Customise' > 'Toolbars' or

'Tools' > 'Customise' > 'Toolbars' lead there.

Choose 'Standard' and check the first 'Toolbar Content' 'Commands' named 'Load URL'.

It's a pity that this isn't set by default. (Mimicking bad MS style?)

( 2015-01-02 11:56:23 +0200 )edit

Thanks! Found it via your instructions, but would otherwise have been anything but obvious.

( 2015-01-03 01:57:55 +0200 )edit

@mkraft - If you now think the answer was simply correct you may "ceck" it giving a hint for other users. If you think it shoiuld be completed or rewritten in another way you may answer your own question again.

( 2015-01-03 12:45:22 +0200 )edit

@Lupp . . . Actually, I find the messaging format here very confusing. Especially without quoting I often can't tell whose comment is being addressed in a reply (unless there's an "@").

How do I 'check' the answer (if that's what you meant by 'ceck') -- i.e., to mark it as a 'correct' one?

( 2015-01-05 00:19:02 +0200 )edit

@mkraft - There is a clickable "checkmark" below the "upvote/downvote" marks. But don'r worry. Many questioners don't regard it. Thus it isn't very helpful for other users anyway.

( 2015-01-05 02:07:33 +0200 )edit

@Lupp@mkraft - I feel it would be much better if people would flag answers as correct when they are. However, I am also of the impression that the "check mark" is not sufficiently intuitive. A "click here when answer is correct" button would be better. Also the "up" and "down" button for voting is the same. "vote up", "vote down" would be better. When people do flag an answer correct, we would get a much better picture of the situation.

( 2015-01-05 02:37:48 +0200 )edit

The suggested solution by @Lupp is nice but the file name box near top left of the open window is often too small (short) to display the full path (URL) to the file that is open. It would be much better (IMHO) if the full path were displayed in the top bar (title bar) of the window where now only the file name is displayed. As far as I can tell, the requested enhancement has never been acted upon by the developers. What does it take to display the full path, when LibreOffice is certainly aware of exactly where the open file is located?

I have not been able to find an extension to LO that might accomplish this. Perhaps I have missed it.

I apologize if I seem agitated about this, but this "problem" is a frequent source of uncertainty and bother in my daily activities when using LibreOffice.

( 2020-08-30 18:34:36 +0200 )edit

@ve3oat: As an experienced user of this site you surely know that discussion about bugs and enhancements is going on in https://bugs.documentfoundation.org. Except for a few developers also posting here, you only will be read by ordinary users, and you won't ghet much attention anyway for comments of this kind, I'm afraid.
However, it's very simple to show the full path in ThisComponent.Title which is the string displayed in the title bar of the window in front of the module notification.
You may place the following "macro" in a module of your local Standard library, and assign it to a new item added to one of your toolbars:

Sub showFileLocationInTitleBar()
u = ThisComponent.URL
If u = "" Then Exit Sub REM The document was not yet stored.
uWithoutProto = Split(u, "file://")(1)
ThisComponent.Title = uWithoutProto
End Sub


(I didn't thoroughly check for every possible ...(more)

( 2020-08-30 21:07:18 +0200 )edit

You are right, of course, @Lupp. And I am sorry. I was "googling" for an extension to solve the problem and this item from AskLO came up -- couldn't resist making my comment. I shouldn't have. Sorry.

Thanks very much for the code. I will try that.

( 2020-08-30 22:00:02 +0200 )edit

There is a request for enhancement Add an option to show the full path in the window title.. Please add you comment.

more

As I already commented in the other thread under not too rare circumstances the title bar might not be wide enough to fit the complete path-name in. The control I named may also not be wide enough but it can be scrolled moving the cursor.

( 2015-01-01 22:59:19 +0200 )edit

Done.

https://bugs.freedesktop.org/show_bug...

( 2015-01-02 02:30:39 +0200 )edit

From File menu take Properties and then the General tab.

more

1

> From File menu take Properties and then the General tab.

Thanks. That's rather indirect, though. I was hoping for something that could be made to automatically display the path (i.e., as a 'preference').

( 2015-01-02 01:47:20 +0200 )edit

The menu/keyboard shortcut does make this a bit easier: Alt + F, I (Although, if you've previously left the Properties window on a different tab then you'll still need to navigate back to the "General" tab.)

( 2019-01-29 14:13:42 +0200 )edit

Hello everybody,

I know this is an old topic but I think my work can inspire and help others.

I searched a convenient way to display the full location of the current document in the titlebar and I found this thread (among several others) BUT I had not found my happiness which meets my need...

I spent many hours to search, test and I found an acceptable solution which fit to my needs which manage both local and network documents access (I have a NAS and many documents on it).

The solution uses LibreOffice macros written in Basic and the "on_DocLoad" code is triggered by the "Open Document" event.

To install it, just copy/paste "as is" the Github code in a macro module (welcome to use the default Module1 module or to add yours), and connect the "Open Document" event to the "on_DocLoad" code of the module ... and "That's all Folks!" :)

Nota : for connect an event to a module's code see here

Disclaimer : this code is suited for Linux ; you are welcome to modify it to fit for Windows or ...

See you soon

lnj

more

In at least some modules (and probably all but did not verify) there is an easier method to get the location rather than Shell & files:

ThisComponent.Location


Then you can use existing routines in the Tools library. See -> [Calc] How to reference document name in macro?

:)

( 2020-06-12 04:40:31 +0200 )edit

Hello,

My LO version : 6.2.6.2

"ThisComponent.Location" or "ThisComponent.getLocation()" (which give the same thing) doesn't work in my cases....

For a file named "with space and accentué.odt" (I am french :) ) in a folder named "with space" it gives for :

local : file:///home/user/Documents/with%20space/with%20space%20and%20accentu%C3%A9.odt and for smb share : smb://NAS.local/test/with%20space/with%20space%20and%20accentu%C3%A9.odt

So I tried to find a way to natively convert URL to give a location more readable but I found nothing ... so I had no other choice to accomplish this that to implement a 3rd party solution.

But I always search a native solution...

( 2020-06-12 10:20:19 +0200 )edit

You can probably guess why I never use spaces in my file or directory names -- lots of hyphens and occasional under-scores, but never spaces.

( 2020-06-12 18:11:51 +0200 )edit
1

Spaces in directories, file name, database table names and fields and so much more - leads to many complications.

( 2020-06-12 19:48:31 +0200 )edit

There is another possibility that was tried under Linux. The 'File Explorer' (Files) is opened and a 'Libre Office' document is opened. If a document is dragged from the 'File Explorer' into the 'Libre Office' document then LO opens a new 'Insert Section' and it is possible to find the path of the document into the 'File name' field.

more

A new answer for an old question: This solution does not present the path in the title bar but, it is simple and does so in a cell. The formula is:
=CELL("filename").
In many of my spread sheets, for conveninence, I place this formula in one of the top left cells.

more

The question was tagged writer.
In a TextDocument you might use a textfield supporting the relevant service com.sun.star.text.textfield.FileName and having set the value 0 for the attribute FileFormat.
I doubt if many users woul like to have it on every page.
Showing the FilePath in the title bar of the document's window might be preferable, and can work for every kind of document in the same way.

( 2020-08-31 21:54:51 +0200 )edit