Forum Discussion

bhaugurav's avatar
bhaugurav
Occasional Contributor
16 years ago

How to use FindChild method with WPF objects?

I have a checkbox on a window having its Name property as WPFObject("checkboxFailed").

I am trying to find it using

set chkBox = parentWindow.FindChild("Name","WPFObject(""checkboxFailed"")",20) .



But it is giving vbscript runtime error as - Type Mismatch 'WPFObject'



Am i making some mistake here?



Thanks in advance,

Bhau

2 Replies


  • Hi Bhau,





    Try using the code below:



    set chkBox = parentWindow.FindChild("Name","*checkboxFailed*",20)







    BTW, we do not recommend using the Name property to obtain an object, as it is not a stable property. Please read the "FindChild Method" article for details.