Pass Values from .NET Windows App to Open IE Form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to pass several values from a .NET Windows app into an EXISTING, OPEN
IE form.

I found the following code snipped for VB6 elsewhere on the forums--it's
close:

Dim IE As Object
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.navigate "http://www.kbb.com"
Do Until IE.readyState = 4
DoEvents
Loop
IE.Document.emailsignup.email.Value = "MYEMAIL"

But...
* I need to do with a .NET Windows app, not VB6
* The IE window will already be open (the user must sign on and display it
first--code cann't do that)
* Once items on the IE form have been filled, the IE Window needs to be
brought in focus so the user can fill in other form elements before
submitting.

Ideas?

THANKS!
 
GPeck said:
I need to pass several values from a .NET Windows app into an EXISTING,
OPEN
IE form.

I found the following code snipped for VB6 elsewhere on the forums--it's
close:

Dim IE As Object
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.navigate "http://www.kbb.com"
Do Until IE.readyState = 4
DoEvents
Loop
IE.Document.emailsignup.email.Value = "MYEMAIL"

But...
* I need to do with a .NET Windows app, not VB6
* The IE window will already be open (the user must sign on and display it
first--code cann't do that)

Only one window? If more than one, how will your code tell which is which?
The above code works because it creates the IE window.
* Once items on the IE form have been filled, the IE Window needs to be
brought in focus so the user can fill in other form elements before
submitting.

Ideas?

Were you aware that you can host IE within a VB6 or .NET application? If you
use the WebBrowser control, you'll be in charge of that IE window. You're
not going to get that level of control over arbitrary IE windows your users
have created.

John Saunders
 
John,

Thanks for the reply.

However, as I mentioned, the user will have already opened an IE session to
sign on to an app (my code can't do that for various reasons). So, by design,
my app will need to fill in a form in an existing IE session, despite the
ability to host IE within the app with a WebBrowser control. Also, the user
will need to be able to futher modify the form manually before they submit it.

In terms of the possibility of multiple IE sessions open--that is a
possibility. My app will need to query all open IE sessions and pick the one
with the proper <TITLE> tag.

- George -
 
Back
Top