Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Web Browser Form Navigation
Message
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00833959
Message ID:
00834070
Views:
51
This message has been marked as the solution to the initial question of the thread.
Troy,

It's pretty easy to automate a form in IE:
oIE = createobject( "internetexplorer.application" )
oIE.Visible = .t.
oIE.Navigate( "www.google.com" )
do while oie.Busy()
   doevents
enddo
loDoc = oIE.Document && get the Document object
loForm = loDoc.forms(0) && get the first form object
loForm.Item(3).Value = "foxpro" && this is the field for the search string
loform.Submit() && submit the form
you can use code like to find the items of a form:
* explore the form items

for i = 0 to loForm.Length-1
   ? i, loForm.Item(i).Name, loForm.Item(i).Value
endfor
You can also access the items by their names:
loItem = loForm.item( "q" )
loItem.value = "this is so cool"
If you have VFP8 or VFP7 this stuff becomes really trivial because of Intellisense. You can just kind of explore things from the command window. You can also lookup IE DocumentObjectModel (DOM) on MSDN to help direct your explorations.


>Using the Microsoft Web Browser control, how can I enumerate thru the forms and field to get a list of names and values? In other words, I need to navigate to any site and want to display the form field names for each form and their values.
>
>I can get as far as olewebbrowser.document.forms, but I always get a syntax error when trying ...forms(1).field(1)...
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform