Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Automation and IE
Message
 
À
19/07/2005 12:10:52
Tim Muller
Innovative Solutions, Inc.
West New York, New Jersey, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
01024241
Message ID:
01034160
Vues:
23
Ok, so it is not the Print Button form the menu that you want, but rather a print button on the webpage. That all depends how the webpage is constructed. Some webpage constructed in a signle HTML file will allow you to send "TAB"s using sendkeys() and then sending an "Enter" once you are on the button. But most pages these days are constructed of Framesets where it is difficult to guess "where the user is at this point".
Perhaps Rick Stralh article on IE automation can help you calling a UDF in a web page. Take a look at this article (specially the section "Accessing HTML script from your VFP code" )
http://www.west-wind.com/presentations/shellapi/shellapi.asp





>Mike--
>
>
>>>>>I do not understand the "about:blank" parameter to the navigate method.
>>
>>Just a generic Internet Explorer blank page which was for the purpose of the example faster to load than an actual website. Since you are going to use an actual website you may consider to add (after the navigate method) and wait window timeout or an API sleep() call to let the page load, otherwise it will throw an error.
>>
>>>
>>>>
#DEFINE OLECMDEXECOPT_PROMPTUSER 1
>>>>#DEFINE OLECMDID_PRINT 6
>>>>oIE = CREATEOBJECT('internetexplorer.application')
>>>>oIE.navigate('about:blank')
>>>>_screen.Visible = .f.
>>>>oIE.ExecWB(OLECMDID_PRINT , OLECMDEXECOPT_PROMPTUSER)
>>>>oIE.visible = .t.
>
>
>Sorry, I did not make myself clear. The user will go so a web site, enter some data. The user eventually gets to the point where the information he/she wants is on the screen. At that point the user will start my VFP program. My program needs to check some things and then using Auomation "click" on the "print command button" on the web page (or just run the JavaScript UDF PrintReport which appears to be the point of the "print command button").
>
>How using Automation do I "click on a command button" or call a JavaScript UDF?
>
>
>Tim
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform