Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - click in a IE child window

Reply
 
Old 01-01-2009   #1 (permalink)
Reventlov


 
 

click in a IE child window

Hello,
When I do a Ricerca.click I get a child window with the results of the search. Is there a
way to click to an item in the child window?
Thank you.

Set oIE = WScript.CreateObject("InternetExplorer.Application")
oIE.navigate("about:blank")
oIE.visible = 1
RicercaDocumenti="http://cor/azione.asp"

oIE.navigate(RicercaDocumenti)
Do until oIE.readystate = 4 : wscript.sleep 10: Loop

oie.Document.Forms(0).item("nr_prot").Value = "1368223"

Set Ricerca=oIE.document.body.getElementsByTagName("INPUT").Item(10)
Ricerca.click

Do While(oIE.Busy): WScript.Sleep 100 :Loop
Set ImmagineDettaglio=oIE.document.body.getElementsByTagName("A").Item(0)
ImmagineDettaglio.click

--
Giovanni Cenati (Bergamo, Italy)
Write to "Reventlov" at katamail com
http://digilander.libero.it/Cenati (Esempi e programmi in VbScript)
--

My System SpecsSystem Spec
Old 01-05-2009   #2 (permalink)
mr_unreliable


 
 

Re: click in a IE child window

hi Reventlov,

I can't understand why the multitude of experts here
has not answered your inquiry as yet.

afaict, you code looks o.k. to me.

The only thing I can think of is that the (child) page
element you are clicking on may not have appropriate
click event handlers ("onClick = ") which may explain
why nothing happens (if your question was why doesn't
anything happen?)...

cheers, jw
____________________________________________________________

You got questions? WE GOT ANSWERS!!! ..(but, no guarantee
the answers will be applicable to the questions)




Reventlov wrote:
Quote:

> Hello,
> When I do a Ricerca.click I get a child window with the results of the search. Is there a
> way to click to an item in the child window?
> Thank you.
>
> Set oIE = WScript.CreateObject("InternetExplorer.Application")
> oIE.navigate("about:blank")
> oIE.visible = 1
> RicercaDocumenti="http://cor/azione.asp"
>
> oIE.navigate(RicercaDocumenti)
> Do until oIE.readystate = 4 : wscript.sleep 10: Loop
>
> oie.Document.Forms(0).item("nr_prot").Value = "1368223"
>
> Set Ricerca=oIE.document.body.getElementsByTagName("INPUT").Item(10)
> Ricerca.click
>
> Do While(oIE.Busy): WScript.Sleep 100 :Loop
> Set ImmagineDettaglio=oIE.document.body.getElementsByTagName("A").Item(0)
> ImmagineDettaglio.click
>
My System SpecsSystem Spec
Old 01-05-2009   #3 (permalink)
Reventlov


 
 

Re: click in a IE child window

Il giorno Mon, 05 Jan 2009 14:28:22 -0500, mr_unreliable
<kindlyReplyToNewsgroup@xxxxxx> ha scritto:
Quote:

>I can't understand why the multitude of experts here
>has not answered your inquiry as yet.
>
>afaict, you code looks o.k. to me.
>
>The only thing I can think of is that the (child) page
>element you are clicking on may not have appropriate
>click event handlers ("onClick = ") which may explain
>why nothing happens (if your question was why doesn't
>anything happen?)...
Quote:

>> Ricerca.click
>> Do While(oIE.Busy): WScript.Sleep 100 :Loop
Quote:
Quote:

>> Set ImmagineDettaglio=oIE.document.body.getElementsByTagName("A").Item(0)
>> ImmagineDettaglio.click
Thank you mr_unreliable,
After Ricerca.click I have the result in a child window after a few seconds.
My code waits until the main window (in which I click on the research/ricerca button) is
ready and tries to click the image ImmagineDettaglio which should show the details of the
document.
The fact is that the main window is immediately ready and when I set a reference to
ImmagineDettaglio there is no such <a> tag in the window. Because I'm looking for it in
the same window of the search button.
1) I should wait until the CHILD window is ready (not the main window).
2)And I should click on the <a> tag "immagineDettaglio" on the child window. My code fails
while attempting to find the first <a> tag in the window when I would have to reference to
it in the child window.
By the way, how could I run a function in the html page?

It is a web-based document managment program which normally has 2 frames (a toolbar and a
working area). I'm trying to access the working area because it starts in a quite complex
way and I was not able to navigate from the 2-frames page.
My purpose is to automagically close old documents while I'm at lunch. And keep in
evidence only those who require a follow-up.


--
Giovanni Cenati (Bergamo, Italy)
Write to "Reventlov" at katamail com
http://digilander.libero.it/Cenati (Esempi e programmi in VbScript)
--
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
getting handle of child window with input focus Vista General
window explorer right click menu General Discussion
Right click won't close the window... Vista performance & maintenance


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46