SetCommonFilters

Replaces the Filter with the pairs Text Files and All Files.

Syntax: object.SetCommonFilters

object
required An object expression that evaluates to a cDialog.

Remarks

SetCommonFilters calls ClearFilter, so any earlier filter is lost, and then AddFilter for each pair:

Description Pattern
Text Files (*.txt) *.txt
All Files (*.*) *.*

The descriptions are fixed English text. To show other text, build the filter with AddFilter. The first pair, Text Files, is the one that the dialog selects when it opens. A call of AddFilter after SetCommonFilters appends a pair at the end.

Example

Dim dlg As New cDialog
dlg.Filter = "Old|*.old"
dlg.SetCommonFilters
Debug.Print dlg.Filter   ' Text Files (*.txt)|*.txt|All Files (*.*)|*.*

dlg.AddFilter "Logs (*.log)", "*.log"
Debug.Print dlg.Filter   ' Text Files (*.txt)|*.txt|All Files (*.*)|*.*|Logs (*.log)|*.log

See Also