Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Automate WebSite
Message
 
 
À
27/02/2004 04:46:04
Marcus Hüneke
Heidelberger Druckmaschinen
Wiesloch, Allemagne
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00881118
Message ID:
00881477
Vues:
35
Marcus,

You can use either numbers or names in the Item() method.
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.


>oIE.document.forms(1).BAPI1007-CUSTOMER.value = "MyUserName"
>and
>oIE.document.forms(1).BAPIUID-PASSWORD.value = "MyPassWord"
>
>leads to a syntax error because of the dash (-)
>I was told Fox interprets that as a minus instead of a hyphen
>
>also tried
>oIE.document.forms(1)."BAPIUID-PASSWORD".value = "MyPassWord"
>
>But this leads to another error. "Element forms can not be evaluated to an object". Sorry for the bad translation (it is a German error message)
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform