Platform SDK: CDO 1.2.1

Item Property (Columns Collection)

The Item property returns the specified Column object from the Columns collection. Read-only.

Syntax

objColumnsColl.Item(index)

objColumnsColl.Item(propTag)

index
Integer. Value must be greater than 0 and less than or equal to 65,535 (&HFFFF). Specifies the index within the Columns collection.
propTag
Long. Value must be greater than or equal to 65,536 (&H10000). Specifies the 32-bit property tag of the renderable property corresponding to a column in the collection. The renderable property is indicated in the Column object’s Property property.

The Item property is the default property of a Columns collection, meaning that objColumnsColl(index) is syntactically equivalent to objColumnsColl.Item(index) in Microsoft® Visual Basic® code.

Data Type

Column object

Remarks

The Item property works like an accessor property.

If the specified Column object is not found in the collection, the Item property returns Nothing.

Although the Item property itself is read-only, the Column object it returns can be accessed in the normal manner, and its properties retain their respective read/write or read-only accessibility.

Example

This code fragment shows the Count and Item properties working together:

' Put all column names in a collection into a string array 
Dim strItemName(100) as String 
Dim i As Integer ' loop counter 
' error handling omitted from this fragment ... 
For i = 1 To objColumnsColl.Count 
    strItemName(i) = objColumnsColl.Item(i).Name 
    ' or = objColumnsColl(i) since Item and Name are default properties 
    If 100 = i Then ' max size of string array 
        Exit Function 
    End If 
Next i