Returns or sets a default filter for an Open or Save As dialog box.
Object.FilterIndex [ = lFilterIndex ]
The FilterIndex property syntax has the following parts:
|
Name |
Type |
Description |
|
Object |
ACommonDialog |
ACommonDialog control |
|
lFilterIndex |
Long |
The default filter for an Open or Save As dialog box. |
This property specifies the default filter when you use the Filter property to specify filters for an Open or Save As dialog box. The index for the first defined filter is 1.
The following example will set the default filter to the second filter:
cdlg1.Filter="Text (*.txt)|*.txt|Pictures (*.bmp;*.ico)|*.bmp;*.ico"
cdlg1.FilterIndex=2
FileName, FileTitle, Filter, InitialDir, SaveAsOptions, ShowSaveAs