How to get full path of specific folder

asked 2019-11-05 10:51:44 +0100

lonk gravatar image

From dialogs.FilePicker and after selecting a file, I got the file namely :


On the other hand, how to get full path of Linux mandatory of folder namely 'Downloads' :


in order to attach another file namely e.g. ER_CSV1_2019-10-29.csv next to it ?

| Fedora 31 Workstation KDE of Fedora from Spins | LibreOffice |

edit retag flag offensive close merge delete


This question is not quite clear to me but may be:

Sub CurrentFolder()

 dim sURL as String
 dim sPath as String

 sURL = DirectoryNameoutofPath(ThisComponent.getURL(),"/")  REM As URL
 sPath = ConvertFromURL(sURL)                               REM As Path 

End Sub

is what you are looking for.

Opaque gravatar imageOpaque ( 2019-11-05 14:33:06 +0100 )edit

Dear @Opaque ,

MsgBox "sURL = " & sURL & CHR(13) & "sPath = " & sPath

sURL = file:///home/fedora002/Documents/LibreOfficeSampleCode
sPath = /home/fedora002/Documents/LibreOfficeSampleCode

Please let me give more information - User downloads a file from web page and Firefox saves such file into this folder,


And from your code, can you please help? I'd like to have the results as hereunder:

sURL = file:///home/fedora002/Downloads/
sPath = /home/fedora002/Downloads/
lonk gravatar imagelonk ( 2019-11-06 03:23:23 +0100 )edit