API Documentation > CorelDRAW > 2025-v26 > CorelScriptTools > ICorelScriptTools
CorelScriptTools.GetFileBox method
Gets File Box
Syntax:
Function GetFileBox(Optional ByVal Filter As String = "All Files (*.*)|*.*", Optional ByVal Title As String = "", Optional ByVal Type As Long = 0, Optional ByVal File As String = "", Optional ByVal Extension As String = "", Optional ByVal Folder As String = "", Optional ByVal Button As String = "") As String
Parameters:
Name Type Description
Filter
String
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
String
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
Long
Specifies the type of dialog box to display: 0 = File Open dialog box (default if omitted) 1 = File Save As dialog box
File
String
Specifies the text to display in the File name text box of the dialog box. If not specified, the text box is empty.
Extension
String
Specifies the default extension to append to a filename if the user omits the extension
Folder
String
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
String
Specifies the button name to override the Open or Save button in the dialog box. If not specified, the button's name remains unchanged.
Remarks:
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.
Examples:
Here is a code example:
SETCURRFOLDER = "c:\COREL50\DRAW\samples" 'set the current folder Filename$=GETFILEBOX("Included Scripts|*.csc|All Files|*.*", "Scripts included...", 0,"animals")