Item Method

Applies To:

Fields collection


Returns the Field object indicated by the Index argument.


LPDISPATCH/Object Fields.Item ( VARIANT index )
LPDISPATCH/Object Fields ( VARIANT index )

index a number or string


This is the default method of the Fields collection; thus the syntax doesn't require explicit inclusion of Item.


The following VB code uses the index of a field with index 2 to get its name.
Dim DocField As Object     'Field object
Dim FieldsColl As Object   'Fields collection
Dim FieldName As String    'Name of field


'Set field to the field with index = 2
Set DocField = FieldsColl.Item(2)
'The statement, "Set DocField = FieldsColl(2)" also works.

'Get the Name of field 2
FieldName = DocField.Name

See Also:

Document Object

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