Retrieves the handle of the root item giving its index into the root items collection.
Type | Description | |||
Position as Long | A long value that indicates the position of the root item being accessed. | |||
HITEM | A long expression that indicates the handle of the root item. |
A root item is an item that has no parent (ItemParent() = 0). Use the RootCount property of to count the root items.
The following sample enumerates all root items:
Dim i As Long, n As Long With Group.Items n = .RootCount For i = 0 To n - 1 Debug.Print .CellCaption(.RootItem(i), 0) Next End With