09-23-2008, 10:04 PM
One way to do would be by using a case statement. But, if you have more objects this way would become a pain. Since you only have 4 objects you can use this way.
Code:
Set oLevel1 = Description.Create()
...
For Iterator = 1 To 4 Step 1
Select Case Iterator
Case 1
Set List = parentFrame.ChildObjects(oLevel & nLevel) 'get childs from e.g. oLevel1 object
...
Case 2
Set List = parentFrame.ChildObjects(oLevel & nLevel) 'get childs from e.g. oLevel2 object
...
Case 3
Set List = parentFrame.ChildObjects(oLevel & nLevel) 'get childs from e.g. oLevel3 object
...
Case Else
Set List = parentFrame.ChildObjects(oLevel & nLevel) 'get childs from e.g. oLevel4 object
...
End Select
Next