Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Controlling IE, passing text into a textbox
Message
From
14/01/2002 07:44:22
 
 
To
14/01/2002 03:10:38
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00604180
Message ID:
00604220
Views:
21
>Hi
>
>I have a page which has a text box on it and a button.
>
>I want to be able to place some sext into the Box, and click on the submit button.
>
>I know how to create an instance of IE, but do not know the objects to manipulate to enable me to place the text and click on the button via automation
>
>Does anyone have an example of how to do this
>
>Hope you can help
>
>Regards
>
>
>Steven

One method would be to use the GetElementByID method of the Document property from the browser.

Assuming you have named the textbox "text1" & the button as "button1" on the HTML page, something like the following should work :
CurDoc = thisform.browser1.Document
TxtBox = CurDoc.GetElementByID( "text1" )
TxtBox.InnerText = "Some New Text"
Button = CurDoc.GetElementByID( "button1" )
Button.Click()
Len Speed
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform