Platform SDK: CDO for Windows 2000

Item Property

The Item property returns the BodyPart object specified by index value.

[Visual Basic]
Property Item(ByVal Index as Long) as IBodyPart
read-only
default
[C++]
HRESULT get_Item( long Index, IBodyPart** pVal);
[IDL]
HRESULT [propget,id(0)] Item([in] long Index, [out,retval] IBodyPart** pVal);

Remarks

Item is the default member on the interface.

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
                                ' Item is default
                                ' Explicitly typing ".Item" is unnecessary
      Set iBp_local = iBps.Item(I) 
      ProcessBodyPart iBp_local
    Next I
  End If
End Sub