FileDialog.Filter Property

 FileDialog.Filter  (read-write, String)
 
A list of filter strings, delimited by the vertical bar (|) character. See Remarks for details.

Syntax

FileDialog.Filter [= String]

The property syntax has these parts:

Part Description
Value (String) A list of filter strings, delimited by the vertical bar (|) character. See Remarks for details.

Remarks

The Filter property determines what appears in the File Types combo-box, and which files are displayed in the File Name list box. The Filter is a string containing one or more filter specifications. Each filter specification consists of two parts, separated by a vertical bar character. The first part in each pair is a display string that describes the filter (for example, "Text Files (*.txt)"), and the second part specifies the filter pattern (for example, "*.TXT"). To specify multiple filter patterns for a single display string, use a semicolon to separate the patterns (for example, "*.TXT;*.DOC;*.BAK"). A pattern string can be a combination of valid file name characters and the asterisk (*) wildcard character. Do not include spaces in the pattern string. The system does not change the order of the filters. It displays them in the File Types combo box in the order specified in lpstrFilter. If Filter is empty, the dialog box does not display any filters.

Examples:


dlg=Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*"
dlg.Filter = "Script Files (*.vbs;*.js)|*.VBS;*.JS|"