Hi guys. I am new here and i am glad being a member of your community.
I am developing a project which in fact is a batch function for a client of mine.
The project is about the following:
I have a button on the windows form and a webbrowser control.
When i click the button, then a webpage runs in the webbrowser control, which converts another webpage in a word document. So, inevitably, an open/save/cancel dialog box appears and the user needs to press the save button there. But my client wants to make several word documents without being present at the time....Just presses the button, and the webpage runs with different id's everytime. So i need to press the save button automatically. And there begins my problem with SendKeys.Send()
I am using the following code (on the click event of the button):
--------------------------------------
Application.DoEvents()
Me.wbBrowser.Navigate("//localhost:3200/homesite_backup/makewordfile.aspx?idInteger=3223")
Application.DoEvents()
Sleep(3000)
SendKeys.Send("{TAB 3}")
SendKeys.Send("{ENTER}")
Application.DoEvents()
--------------------------------------
Although the first Send of the TABS works just fine, the second does absolutely nothing. It seems like the ENTER press does not work nevertheless.
I've tried SendKeys.Send("s") and SendKeys.Send("~") also, but nothing happens.
Any ideas ?
Thanks in advance for your help!
I am developing a project which in fact is a batch function for a client of mine.
The project is about the following:
I have a button on the windows form and a webbrowser control.
When i click the button, then a webpage runs in the webbrowser control, which converts another webpage in a word document. So, inevitably, an open/save/cancel dialog box appears and the user needs to press the save button there. But my client wants to make several word documents without being present at the time....Just presses the button, and the webpage runs with different id's everytime. So i need to press the save button automatically. And there begins my problem with SendKeys.Send()
I am using the following code (on the click event of the button):
--------------------------------------
Application.DoEvents()
Me.wbBrowser.Navigate("//localhost:3200/homesite_backup/makewordfile.aspx?idInteger=3223")
Application.DoEvents()
Sleep(3000)
SendKeys.Send("{TAB 3}")
SendKeys.Send("{ENTER}")
Application.DoEvents()
--------------------------------------
Although the first Send of the TABS works just fine, the second does absolutely nothing. It seems like the ENTER press does not work nevertheless.
I've tried SendKeys.Send("s") and SendKeys.Send("~") also, but nothing happens.
Any ideas ?
Thanks in advance for your help!