Tuesday, August 5, 2008

To find the child objects & their class in the application

Dim oDesc
Set oDesc = Description.Create()
Set parent = Window("Text:=Flight Reservation")
Set children = parent. ChildObjects (oDesc)
co = children.Count
MsgBox co
k=0
For j = 1 to (co-1)
cln= children(j).GetROProperty("micclass")
Select Case(cln)
case("WinEdit")
Objpr = children(j).GetROProperty("attached text")
case("WinButton")
Objpr = children(j).GetROProperty("text")
case("WinComboBox")
Objpr = children(j).GetROProperty("attached text")
case("AciveX")
Objpr = children(j).GetROProperty("Progid")
case("WinObject")
Objpr = children(j).GetROProperty("text")
case("Static")
Objpr = children(j).GetROProperty("text")
End Select
If Objpr <> "" Then

msgbox cls & " " & Objpr
End If

Objpr = ""
Next
MsgBox k


Regards,

PavanKumar Nandagiri.....................

Google Search

Google