Function GetFileBox([Filter As String = "All Files (*.*)|*.*"], [Title As String], [Type As Long], [File As String], [Extension As String], [Folder As String], [Button As String]) As String
The GetFileBox method displays a standard Windows File}Open or File}Save As dialog box. Both dialog boxes allow users to choose a file from the file system. The GetFileBox function returns the selected filename and its full path, or an empty string if the user chooses Cancel. The GetFileBox statement by itself does not open or save a file; it only returns a string corresponding to the selected file.
Parameter
Definition
Filter
Specifies the filters to use in the dialog box. For the Open dialog box, the filters are listed in the Files of Type list box. For the Save As dialog box, the filters are listed in the Save as Type list box.
Filters are specified in two parts. The first part is the text that appears in the list box, and the second part is the actual filter extension. The parts are separated by the vertical bar [ | ]; do not use spaces before or after this character. To separate multiple filters, use the vertical bar. For more information, see the example that follows.
Title
Specifies the title to display in the dialog box. If not specified, Open is displayed for an Open dialog box and Save As is displayed for a Save As dialog box.
Type
Specifies the type of dialog box to display:
0 = File Open dialog box (default if omitted)
1 = File Save As dialog box
File
Specifies the text to display in the File name text box of the dialog box. If not specified, the text box is empty.
Extension
Specifies the default extension to append to a filename if the user omits the extension
Folder
Specifies the default folder used by the dialog box. If not specified, or if the specified folder does not exist, the current folder is used.
Button
Specifies the button name to override the Open or Save button in the dialog box. If not specified, the buttons name remains unchanged.
Example
Here is a code example:
SETCURRFOLDER = "c:\COREL50\DRAW\samples" 'set the current folder