Home > Language Reference > User Dialog Functions > SelectMultipleFile


The SelectMultipleFile function displays the standard Open File dialog box and returns the user multiple selection in an array.


Used to display information at a point in a script without any user intervention.


count=SelectMultipleFile(<title>, <folder>, <mask>, <selected_folder>, tabfilename$())


<title>, string, text to display in the title bar of the dialog box.

<folder>, string, name of the folder to open. If the specified folder is invalid, the default folder is C:.

<mask>, string, list of file types allowed in the dialog box. The syntax is "*.txt;text files (*.txt)" for *.txt files with the label text files (*.txt). To include multiple types, use ; separator, see the example.

, variable, string. It returns the folder name for the selected files.

tabfilename$(), variable, array of strings. The array must be declared at the beginning of the script using Dim. The name (without its path) of each file selected by the user is returned in this array, starting at index 0.

Return value

count, optional integer. If the function succeeds, it returns the count of selected files. If the function fails (the Cancel button has been clicked for example), the return value is 0.

See also



Dim filename$(10)        'Declare the array
var=SelectMultipleFile("Select the file", "C:\wttest","*.txt;text files (*.txt);*.doc;documents (*.doc)",folder$,filename$())
msgbox(folder$)           'Display the foldername where the files are selected
msgbox(filename$(0))   'Display the filename of the first file selected
msgbox(filename$(1))   'Display the filename of the second file selected 
msgbox(var)                 'Display how many files have been selected