VBScript code for Scrolling

Can any tell me what is the script for scrolling on any browser from top to bottom and viceversa using VBscript?

Showing Answers 1 - 2 of 2 Answers

sri_yarley

  • Jul 27th, 2011
 

You can try one of the following:

Set Obj=Browser("browsername").Page("Pagename").Object.body
Obj.doScroll("pageUp")

Or

'for page down

Set objShell=CreateObject("WScript.Shell")
objShell.SendKeys "{PGDN}"

'for page up

Set objShell=CreateObject("WScript.Shell")
objShell.SendKeys "{PGUP}"

  Was this answer useful?  Yes

sri_yarley

  • Jul 27th, 2011
 

There are couple of ways for doing this.

Code
  1.  

  2.  

  3. 'For page up

  4. Set Obj=Browser("browsername").Page("pagename").Object.body

  5. Obj.doScroll("pageUp")

  6.  

  7. 'For page down

  8. Set Obj=Browser("browsername").Page("pagename").Object.body

  9. Obj.doScroll("pageDown")

  10.  

  11. Or you can also the following Send Keys method:

  12. 'For page up

  13. Set objShell=CreateObject("WScript.Shell")

  14. objShell.SendKeys "{PGUP}"

  15.  

  16. 'For page down

  17. Set objShell=CreateObject("WScript.Shell")

  18. objShell.SendKeys "{PGDN}"

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions