_NewEnum Property

Applies To:

Fields collection


Enumerator object that implements the IEnumVariant interface for the Fields collection.


LPUNKNOWN Fields._NewEnum


This property is rarely used directly, but its presence allows use of constructs such as Visual Basic's For Each/Next loop for iteration over this collection


The following Visual Basic code finds the name of the first structure field:

Dim FinderDoc As Object  'Document
Dim FieldName As String  'Name of field
Dim FieldObj As Object    'Field

'Iterate over fields
For Each FieldObj In FinderDoc.Fields
  If (FieldObj.Type = kCFStructure) Then
    FieldName = FieldObj.Name  'Get name of structure field
    Exit For                   'End For-loop 
  End If
Next FieldObj

See Also:

2005 CambridgeSoft Corporation. All Rights Reserved. Privacy Statement
Tel  800 315-7300 / 617 588-9300     Fax  617 588-9390     Email   info@cambridgesoft.com
CambridgeSoft Corporation, 100 CambridgePark Drive, Cambridge, MA 02140 USA