Hello Community,
I would like to build a dialog box which enables the user to choose file to read. The function I use is "Dialogs.BrowseForFile". The dialog box should allow the user to choose from multiple data types, e.g. .xls and xlsx. At the moment, with this function I can only show one option of this data type as shown below.
I would like to ask is there a possible way to add more data type to the filter? Or is there any other function which enables this multiple filter ?
Thanks in advance!
I assume you're using the Dialogs.getFilePath(...) method?
You can specify which file types are supposed to be available in that drop down menu with the second parameter of that method.
Example for xls and xlsx:
Dialogs.getFilePath("", "*.xls!!Worksheet Files|*.xls|Worksheet Files new|*.xlsx|", "", "Select a file", 0);
The second parameter is a string, and it follows the following syntax
- First describe the filter that is initially supposed to be active, in this case it's the "*.xls" part at the beginning of the string
- Then add two exclamation marks "!!"
Now do all the following steps for each selectable list entry (append the following to the same string you started already)
- Give you closable option a descriptor. In this example it's "Worksheet Files"
- Add a vertical bar "|"
- Describe the filter in the filter format Aris expects (Asterisk-dot-file-extension), in this case it's "*.xls"
- Add a vertical bar "|" (this is very important, even the last list entry you define you have to end with a vertical bar)