Returns the number of item in the collection.
Most of the collections in the Office model are 1-based which means they start at index position 1 rather than 0.

Existing Objects

To loop through all the objects in a collection you can use the "For Each .. Next" construct.
The entire collection can be iterated using the For Each...Next statement.

How to determine if an item already exists

You have to loop through all the items to find the one you are looking for ??
Specific items can be returned using the Item method.
If you want to refer to a member of a collection, you can refer to it by its position in the collection, as an index number starting at 1 or by its name as quoted text.

You will obtain a "subscript out of range" error when you try to access an element in a collection that does not exist. Collections in some respects are similar to arrays.

© 2022 Better Solutions Limited. All Rights Reserved. © 2022 Better Solutions Limited TopPrevNext