| || |
I have the following problem:
I have an image which serves as a link and I want to find it and then click on it. The following code should do that:
</font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;"> Set w = strWindow.Rect(intLeft,objVeld.Top, 30, 20)
If Regions.Find(w, "selectie-image", 0, 0, True) Then
</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">I know the region was found, otherwise the FoundX would contain the value -1. However the Regions.FoundX contains the value 0. And using it to click on the image becomes impossible... anyone an idea what I am doing wrong?
Please note that the Regions.Find method returns the coordinates of the found image relative to the searching area. In your case, the coordinates are relative to the left top corner of the w window. Therefore, you should take this into account when clicking the window:
Call strWindow.Click(Regions.FoundX + intLeft, Regions.FoundY + objVeld.Top)
If this is not the cause of your problem, please send us (firstname.lastname@example.org) the script and a link to the Web page that will allow us reproduce the issue.
BTW, why don't you use the Page.Find function to find the desired page element?
Thank you, that did the trick