John,
In addition to Imran's sample, I normally use:
For Each vAction In [Enum].GetValues(GetType(EnumAction))
Debug.WriteLine(vAction)
Next vAction
In addition to System.Enum.GetValues which gets the values of an Enum, there
is Format, GetNames, IsDefined, Parse and a number of overloaded ToObject
shared methods each which are equally useful for the job they perform.
Hope this helps
Jay
"John A Grandy" <johnagrandy-at-yahoo-dot-com> wrote in message
news:em**************@TK2MSFTNGP11.phx.gbl...
how to iterate through the members of an Enum ?
Enum EnumAction
None = 0
Action1 = 1
Action2 = 2
Action3 = 3
Action4 = 4
End Enum
Dim vAction As EnumAction
For Each vAction In Enum1 ....
Next vAction
triggers error " 'EnumAction' is a type and cannot be used in an
expression
"