Filter Property (AddressEntries Collection)

Filter Property (AddressEntries Collection)

The Filter property returns an AddressEntryFilter object for the AddressEntries collection. Read/write.

Syntax

objAddrEntriesColl.Filter

Data Type

Object (AddressEntryFilter)

Remarks

An AddressEntryFilter object with no criteria is created by default for every AddressEntries collection. When you specify criteria by setting properties in the filter's Fields collection, the filter restricts any subsequent search on the AddressEntries collection. For more information, see the AddressEntryFilter Object and Filtering Messages in a Folder.

An address entry filter can also be inherited from the restriction specified in a CDO Rendering TableView object. Writing any property on this filter disinherits it, refreshes the AddressEntries collection, and instantiates a new address entry filter specifying only the property just written. This new filter, however, is no longer inherited, and the application can read its properties and set additional restrictions within it.

The address entry filter affects traversals of the AddressEntries collection using the Microsoft® Visual Basic® For Each statement, the Get methods, or the Visual Basic For ... Next construction. These accesses return an AddressEntry object.

Example

This code fragment shows how to set a filtering value in an AddressEntries collection's initial default address entry filter, and then how to clear all settings and reset the filter to its default state of no criteria:

Dim objAEColl As AddressEntries ' collection
Dim objAEntry As AddressEntry   ' address entry passed by filter
Dim objAEFilt As AddressEntryFilter
' assume valid AddressEntries collection just created
' make first use of filter to check for names containing "Mac"
Set objAEFilt = objAEColl.Filter ' original empty default filter
objAEFilt.Name = "Mac" ' string used in a name resolution search
For Each objAEntry in objAEColl ' loops and Sets each objAEntry
    ' process address entries that are passed by the filter
Next
' ... later, when current filter settings are no longer needed ...
objAEColl.Filter = Nothing ' invalidates and clears filter
Set objAEFilt = objAEColl.Filter ' new empty filter
' filter now available for new settings
 

See Also

Concepts

AddressEntries Collection Object