Title: Iterating COM Collections
Question: Some COM objects publish the IEnumVariant through the _newEnum as only way to access Items of an array/collection. How can you access these items?
Answer:
Note: If you are using Delphi 2005 or higher, see also my article for...in...do on COM Collections, that gives you a much easier way to iterate COM Collections.
COM Collections - a short introduction
COM Collections are an easy way to enumarate the items of a collection. You may think of the collection as of an array, however, it is not an array. Most collections allow you to access any item within the collection through an index access. Another way is the method of tha ADORecordset iterating all items unter EOF and catching the next by calling the method Move.
However, with VBScript the easiest way usually is a construct like the following:
for each ITEM in COLLECTION
response.write ITEM.value & ""
next