This code is basically complete no-op. The only potentially significant effect this code has is that it will execute the objFolder.SubFolders property or method. If this member has a noticeable side effect, this code may be significant.
This is the rough equivalent of the following C # code
object objSubFolder = null; using (var e = objFolder.SubFolders.GetEnumerator()) { if (e.MoveNext()) { objSubFolder = e.Current(); } }
Please note that this is still not necessarily a 1-1 translation.
- If
objSubFolder previously defined in the method, it would incorrectly replace its value in the collection of empty folders - if the VB code had
Option Explicit Off , then you might need to convert objFolder.SubFolders to dynamic in order to get closer to the same behavior.
source share