Platform SDK: CDO 1.2.1 |
The Item property returns the specified Column object from the Columns collection. Read-only.
objColumnsColl.Item(index)
objColumnsColl.Item(propTag)
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.
Column object
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.
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