# SetCommonFilters
{: .no_toc }

Replaces the [**Filter**](/tB/Packages/Contributed/TBMANLIB_Dialog/cDialog/Filter.md) 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**](/tB/Packages/Contributed/TBMANLIB_Dialog/cDialog/ClearFilter.md), so any earlier filter is lost, and then [**AddFilter**](/tB/Packages/Contributed/TBMANLIB_Dialog/cDialog/AddFilter.md) 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

```tb check_build check_run
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

- [SetDocumentFilters](/tB/Packages/Contributed/TBMANLIB_Dialog/cDialog/SetDocumentFilters.md) method -- office documents
- [SetImageFilters](/tB/Packages/Contributed/TBMANLIB_Dialog/cDialog/SetImageFilters.md) method -- image files
- [SetCodeFilters](/tB/Packages/Contributed/TBMANLIB_Dialog/cDialog/SetCodeFilters.md) method -- source code files
- [Filter](/tB/Packages/Contributed/TBMANLIB_Dialog/cDialog/Filter.md) property -- the whole list as one string
- [cDialog](/tB/Packages/Contributed/TBMANLIB_Dialog/cDialog/index.md) class -- overview
