Forum Discussion
lokithorshield
10 years agoContributor
I am sorry - Did not interpret correctly,
what does this means
'helper function - ---- considering actual state of the object ----?'
scsvel
10 years agoFrequent Contributor
He is saying to write some helper function like below and utilize.
Function FindObject(parentObj, intLevel, strPropChild1, strPropChild2, ...)
Dim intFind
For intFind = 1 To intLevel
Set parentObj= parentObj.Find("strPropChild" & intFind)
'Here you can pass the data like: "ID=ABCD;Name=abcd" and do the manipulation and pass to Find
'Also handle the errors
Next
Set FindObject = parentObj
End Function
For Ex: Consider the below hierarchy and their properties
parent1 --> ID=p1
- Child1 ---> ID=c1 and class=c1
- Child2 --- > Name=abc
Set finalObject = FindObject(parent1, 2, "ID=c1 and class=c1", "Name=abc")