![]() Say the path /usr to be converted to file:///usr.įile_dialog.SetDisplayDirectory(init_path) The ConvertToUrl function transforms the Linux path to a file system path. To set the default directory which would be opened by dialog, use the SetDisplayDirectory method of dialog object. Once defined and filled up, pass it to AddFiltersToDialog function with the dialog object.ĪddFiltersToDialog(FilterNames(), file_dialog) Along with file types we will set the default directory to be selected when the dialog is executed.ĭefine an array containing the file extensions to be loaded in type dropdown. Such as, the file types/extensions (*.jpg, *.png etc) that would be available as filters. Formatting the Dialogīefore opening the file picker dialog, we need to provide some informations for the dialog. The object ucb a.k.a Universal Content Broker provides a way to access various contents via UCP (Universal Content Providers). Ucb = createUnoService(".SimpleFileAccess") ("Tools")įile_dialog = CreateUnoService(".dialogs.FilePicker") These two service will provide necessary handles to open a file selection dialog.ĭeclare and create two objects to these services. To open a file selection dialog, use FilePicker service of module .dialogs and SimpleFileAccess service of module. ![]() ' open file picker dialog here and return the path of the chosen file Lets define a function which can be used from any macro to open a file picker dialog. opening an OpenOffice, LibreOffice workbook, importing a text/csv file etc. This tutorial will show how to open a file selection dialog in LibreOffice, OpenOffice using Macro.įile selection dialog is used to select single/multiple file(s) in various automation activities e.g. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |