Platform SDK: CDO for Windows 2000

Count Property

The Count property returns the number of BodyPart objects in the collection.

[Visual Basic]
Property Count as Long
read-only
[C++]
HRESULT get_Count(long* pVal);
[IDL]
HRESULT [propget] Count([out,retval] long* pVal);

Example

' Reference to Microsoft ActiveX Data Objects 2.5 Library
' Reference to Microsoft CDO for Windows 2000 Library
Sub ProcessBodyParts( iBp as CDO.IBodyPart )
  Dim Count as Long

  ' Process body part code here

  ' Recursively descend body part hierarchy
  Dim iBp_local as CDO.IBodyPart
  Count = iBp.Count
  If Count > 1 Then
    Dim iBps as CDO.IBodyParts
    Set iBps = iBp.BodyParts
    For I = 1 to Count
      Set iBp_local = iBps(I)
      ProcessBodyPart iBp_local
    Next I
  End If
End Sub