Using an Enumerator to Traverse a .NET Collection

Use an enumerator to traverse the contents of a .NET collection.

For example:
IEnumerator myEnum 
CommandBar myCommandBar

myApplication = Microsoft.VisualBasic.Interaction.CreateObject("VisualStudio.DTE.9.0","");
myCommandBars = myApplication.CommandBars ;
myEnum = myCommandBars.GetEnumerator();
do while myEnum.MoveNext()
    myCommandBar = myEnum.Current
    MessageBox ( "CommandBar", myCommandBar.Name )
loop