|element||Variable used to iterate through the elements of the collection or array.|
|group||Name of an object collection or array.|
|statements||One or more statements that are executed on each item in group.|
The Exit For can only be used within a For Each...Next or For...Next control structure to provide an alternate way to exit. Any number of Exit For statements may be placed anywhere in the loop. The Exit For is often used with the evaluation of some condition (e.g. If...Then...Else), and transfers control to the statement immediately following Next.
You can nest For Each...Next loops by placing one For Each...Next loop within another. However, each loop element must be unique.
Dim fso, f, f1, fc, s
Set f = fso.GetFolder(folderspec)
Set fc = f.Files
For Each f1 in fc
s = s & f1.name
s = s & "<BR>"