jus4ujith
jus4ujith

Reputation: 85

Open a web page and click a button in VB script

I want to open a webpage in internet explorer and navigate to a page and click on a button in the page using . For example

This was the only thing i could find (only to open a page in IE ) :

Set WshShell = WScript.CreateObject("WScript.Shell")
Return = WshShell.Run("iexplore.exe www.gmail.com", 1) 

please help me out.

Upvotes: 3

Views: 23739

Answers (1)

Emmanuel N
Emmanuel N

Reputation: 7449

Something like:

 Set IE = CreateObject("InternetExplorer.Application") 
 Set WshShell = WScript.CreateObject("WScript.Shell") 
 IE.Navigate "http://mydomain.com/form.asp" 
 IE.Visible = True 
 Wscript.Sleep 2000 
 IE.Document.All.Item("Item1Id").Value = "1000" 
 IE.Document.All.Item("Item2Id").Value = "1001" 
 IE.Document.All.Item("Item3Id").Value = "Some Text" 
 Call IE.Document.Forms(0).Submit()

Upvotes: 2

Related Questions