Platform SDK: CDO for Windows 2000

_NewEnum Property

The _NewEnum property returns an IEnumVARIANT interface on an enumeration object for the collection. This property is hidden from Microsoft® Visual Basic® and VBScript.

[Visual Basic]
Used automatically in For Each In constructs
[C++]
HRESULT get__NewEnum(IUnknown** pVal);
[IDL]
HRESULT [propget] _NewEnum([out,retval] IUnknown** pVal);

Remarks

This property is hidden within the Visual Basic and VBScript. It is a standard property that is used to support enumerating collections, such as the following syntax in Visual Basic:

For Each Obj in Collection 
  '
Next Obj

Example

' Reference to Microsoft ActiveX Data Objects 2.5 Library
' Reference to Microsoft CDO for Windows 2000 Library
Sub EnumBodyPartsAndXXX( iBp as CDO.IBodyPart )
  Dim iBp_local as IBodyPart
  Dim iBps as IBodyParts
  Set iBps = iBp.BodyParts
  For Each iBp_local in iBps
    ' Code here.
  Next iBp
End Sub