Looking for a way to get Windows file picker to use?

I needed a file picker for porting my old VBA-project to LibreOffice Basic environment…and
was about getting really mad…

oFP = createUnoService("com.sun.star.ui.dialogs.FilePicker")
oFP.appendFilter("csv", "*.csv")
if oFP.execute():
    file_path = uno.fileUrlToSystemPath(oFP.SelectedFiles[0])
1 Like

@karolus, documentation recommends getSelectedFiles instead of getFiles.

1 Like

Thanks, I’ve update the comment above!

FilePicker.odt (15.4 KB)

The FilePicker service mentioned above by @karolus is analogous to the Microsoft Office FileDialog object and has no fewer capabilities.

The former also has the advantage of working on real operating systems, and not just on M$ Windows

2 Likes