FilterIndex Property (ACommonDialog)

Returns or sets a default filter for an Open or Save As dialog box.

Syntax

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.

Comments

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.

Example

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

Applies to

ACommonDialog

See Also

FileName, FileTitle, Filter, InitialDir, SaveAsOptions, ShowSaveAs