I want to show the full path on the title bar. I have not found any setting that allows that.
Request for enhancement, please add there your comment. Show current file name AND path in titlebar, Add an option to show the full path in the window title,
I would like to have this feature. I currently have my novels in directory by location of story, and ran across one I havenât got a logical location to look in. I can bring up the file because I pinned it. I am not a programmer and have no idea how to use the code someone posted. I just want the path of the stupid file! Thanks.
The path to an open file is always shown in File > Properties > General
If you want to see the path in the Standard toolbar in Writer then right click on the Standard toolbar and select Visible buttons > Load URL
Questions to the same effect were asked more than once:
For users wanting to get a solution without needing to wait for the success of a feature request, I posted user code here: How to view 'full path' of open document?.
I currently use myself the following version, where the first two Sub are assigned to the respective events by Customize for the application.
Please note that the Basic IDE uses the .Title of a document in the left panel where the libraries and modules are displayed. If the paths are very long this may result in an annoyance. To shorten the Title a bit, I prefer to not include the protocol part if urlStyle is chosen.
Sub onViewCreated()
showFileLocationInTitleBar(False)
End Sub
Sub onDoumentSavedAs()
showFileLocationInTitleBar(False)
End Sub
Sub showFileLocationInTitleBar(Optional pUrlStyle As Boolean)
If IsMissing(pUrlStyle) Then pUrlStyle = True
url = ThisComponent.URL
If url = "" Then Exit Sub REM The document was not yet stored.
If pUrlStyle Then
pN = Split(url, "://")(1)
Else
pN = ConvertFromURL(url)
End If
ThisComponent.Title = pN
End Sub
I donât work with remote files. With pUrlStyle=False remote files may cause errors. You can include a test. Please report your experiences in this case.
[edit 2024-09-18 about 10:10 UTC]
See also this topic.
[/edit]
For a non-programmer, how do I use this code? Make a macro? Put it someplace else? I need easy steps. Thanks for posting.
This worked for me. First create a macro library, where you can store the macro that will be used, and add the macro:
(This part is adapted from this source)
- Open any LibreOffice application.
- Go to Tools > Macros > Organize Macros > Basic to open the Basic Macros dialog (Figure 1).
- Click Organizer to open the Basic Macro Organizer dialog (Figure 2)
- Select the Libraries tab.
- Set the Location drop-down to My Macros & Dialogs.
- Click New to open the New Library dialog.
- Enter a library name, for example TestLibrary, and click OK.
- On the Basic Macro Organizer dialog, select the Modules tab (Figure 3).
- In the Module list, expand My Macros and select your library (in the example, TestLibrary). A module named Module1 already exists and can contain your macro.
- Select Module1, or the new module that you created, and click Edit.
- Replace all the content of Module 1 with the above proposed macro.
- File > Save, and then close the editor.
Then use the macro:
- Open any LibreOffice application (or use the one you opened before).
- Go to Tools > CustomizeâŠ
- Select the Events tab.
- Select the âSave inâ location as LibreOffice if you want the functionality to be used globally.
- Select the âView createdâ event.
- Click âMacroâŠâ from the Assign options.
- In the Library list, navigate to the macro you saved before and choose onViewCreated in the MacroName list.
- Click OK.
- Optional: repeat steps 17-20 for the Document saved event (choosing onDocumentSaved in step 19).