Platform SDK: CDO 1.2.1

Count Property (AddressLists Collection)

The Count property returns the number of AddressList objects in the collection. Read-only.

Syntax

objAddrListsColl.Count

Data Type

Long

Example

This code fragment uses the Count and Item properties to display the name of every valid AddressList object in the collection:

Dim i As Integer ' loop counter 
Dim hierarchy As AddressLists ' address book hierarchy 
' assume valid session and successful logon 
Set hierarchy = objSession.AddressLists 
' make sure collection is valid 
If hierarchy Is Nothing Then 
    ' Exit "Address book hierarchy is invalid" 
End If 
' see if hierarchy is empty 
i = hierarchy.Count ' count of address lists in hierarchy 
If 0 = i Then 
    MsgBox "No available address books" 
    ' exit ... 
End If 
' display names of all valid address book containers 
For i = 1 To hierarchy.Count Step 1 
    If Nothing = hierarchy.Item(i) Then 
        MsgBox "Address List " & i & " is not valid" 
    Else 
        MsgBox "Address List " & i & ": " & hierarchy(i).Name 
    End If 
Next i