Item Method

Applies To:

Fields collection

Description:

Returns the Field object indicated by the Index argument.

Syntax:

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

index a number or string

Remarks:

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

Example:

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   info@cambridgesoft.com
CambridgeSoft Corporation, 100 CambridgePark Drive, Cambridge, MA 02140 USA