Engine.DisplayOpenFileDialog
- Updated2026-02-03
- 3 minute(s) read
Engine.DisplayOpenFileDialog
Syntax
Engine.DisplayOpenFileDialog( dlgTitle, okButtonText, initialPath, modalToAppMainWind, selectedPath, absolutePath, openFileDialogFlags = 0, defaultExtension = "", win32Flags = WinFileDlg_HIDEREADONLY | WinFileDlg_FILEMUSTEXIST, fileFilter = "", [currentSequenceFile])
Return Value
Returns True if you click OK in the dialog box. Returns False if you click Cancel .
Purpose
Remarks
Launches a dialog box in which the user can select a file. The user can choose whether the dialog box returns an absolute or relative pathname for the file. The dialog box can only return a relative pathname when the file is located under one of the TestStand search directories . If the file is not located under any of the TestStand search directories and the user requests that the dialog box return a relative pathname, the dialog box prompts the user to add the name of the directory that contains the file to the list of TestStand search directories. You can pass a sequence file object to include the directory among the list of valid search directories for a relative pathname.
Parameters
dlgTitle As String
[In] Specifies the title of the dialog box. Pass an empty string to use the default title for the dialog box.
okButtonText As String
[In] Specifies a string to display on the OK button. Pass an empty string to use the default.
initialPath As String
[In] Specifies the path of the directory you want the user to browse initially. Pass an empty string to specify the current directory.
modalToAppMainWind As Boolean
[In] By default, the dialog box is modal to the last active window of the calling thread, or if there is none, to the last active window from AppMainHwnd. If you set this option, the dialog box is modal with respect to the window handle that the Engine.AppMainHwnd property returns. Typically, you do not need to set this option.
selectedPath As String
[Out] Returns the pathname the user specifies in the dialog box. The path can be relative.
absolutePath As String
[Out] Returns the absolute pathname of the file the user selects.
openFileDialogFlags As Long
[In] Pass 0 for the default behavior, or pass one or more OpenFileDialogOptions constants. Use the bitwise-OR operator to specify multiple flags.
This parameter has a default value of 0 .
defaultExtension As String
[In] Specifies the extension to append to the pathname if the user specifies no extension. Do not include the period in the extension.
This parameter has a default value of "" .
win32Flags As Long
[In] Specifies the WindowsFileDialogFlags .
This parameter has a default value of WinFileDlg_HIDEREADONLY | WinFileDlg_FILEMUSTEXIST .
fileFilter As String
[In] Specifies the extensions files must have to appear in the dialog box. Each filter the string contains has two parts. The first part is a descriptive name for the filter and the second part lists the extensions the file can have. Specify multiple extensions using a semi-colon (;) as a delimiter, and end each section with a vertical bar (|). End the string with a final vertical bar (|). The following example illustrates this format:
"Sequence Files (*.seq)|*.seq|Report Files (*.txt;*.htm;*.html)|*.txt;*.htm;*.html||"
This parameter has a default value of "" .
currentSequenceFile As Variant
[In] [ Optional ] Specifies a SequenceFile object if you want to include the directory of the sequence file in the list of valid search directories for a relative pathname.