Code Comments
Programming Forum and web based access to our favorite programming groups.Hi All I have found the code ( below ) to allow me to open the default browser and load a web page. Can anyone tell me how to auto-complete text in a text box on the opened page. The page that I will eventually load has a text input box ( called "Name" ) that I want to automatically fill in with a variable passed from VB. Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long Dim GoToWWW As String GoToWWW = "http://www.mywebsite.com/TestPage.asp" ShellExecute Me.hwnd, "Open", "about:blank", 0, 0, 0 ShellExecute Me.hwnd, "Open", GoToWWW, 0, 0, 1 Regards and thanks in advance for any replies DaveO
Post Follow-up to this message"DaveO" <jsinvest@mweb.co.za> wrote > I have found the code ( below ) to allow me to open the default browser an d > load a web page. > > Can anyone tell me how to auto-complete text in a text box on the opened > page. > > The page that I will eventually load has a text input box ( called "Name" ) > that I want to automatically fill in with a variable passed from VB. Do you even need to open the page? This site has a textbox that you fill out: www.dictionary.com You could go there and type in "NEED" and hit the button, (as you are trying to do programatically), but you don't need to. Rather, just go to the answer page, AS IF you filled in the box and hit the button: http://dictionary.reference.com/search?q=need The same with www.google.com You could go there and type in SEARCH, and hit a button, (programmatically) but you don't need to, just go to the answer page: http://www.google.com/search?hl=en&ie=UTF-8&q=search Will that help? LFS
Post Follow-up to this messageHi Larry Thanks for the feedback. However, I feel that I do need to open the web page and fill in the text in the text box, as my app is to open the web page and fills in some info and the user needs to fill in other text fields before they subit the web page / form. Regards DaveO --------------------------------------------------- "Larry Serflaten" <serflaten@usinternet.com> wrote in message news:uigL7z9oEHA.648@tk2msftngp13.phx.gbl... "DaveO" <jsinvest@mweb.co.za> wrote > I have found the code ( below ) to allow me to open the default browser and > load a web page. > > Can anyone tell me how to auto-complete text in a text box on the opened > page. > > The page that I will eventually load has a text input box ( called "Name" ) > that I want to automatically fill in with a variable passed from VB. Do you even need to open the page? This site has a textbox that you fill out: www.dictionary.com You could go there and type in "NEED" and hit the button, (as you are trying to do programatically), but you don't need to. Rather, just go to the answer page, AS IF you filled in the box and hit the button: http://dictionary.reference.com/search?q=need The same with www.google.com You could go there and type in SEARCH, and hit a button, (programmatically) but you don't need to, just go to the answer page: http://www.google.com/search?hl=en&ie=UTF-8&q=search Will that help? LFS
Post Follow-up to this message"DaveO" <jsinvest@mweb.co.za> wrote > Hi Larry > > Thanks for the feedback. > > However, I feel that I do need to open the web page and fill in the text i n > the text box, as my app is to open the web page and fills in some info and > the user needs to fill in other text fields before they subit the web page / > form. Give them a form to fill in the other info, and then pass it all on to the s erver. You might also try filling the form in the call, for example, you want to a dd the user's name, (Your Name Here) http://www.google.com/advanced_sear...r%20Name%20Here Go there, and see that the form has "Your Name Here" in the top textbox.... LFS
Post Follow-up to this messageHi Larry Thanks for the feedback. I have found that I am unable to shellExecute to a URL ( with additional field values at the end of the URL ) to a htm or html page and get it to fill in text into a form field. I can, however, change the html page to a .php page ( as the page in question resides on my own domain ) and code the .php page to accept a variable passed in the url. I can now ShellExecute to a URL (with a variable attached) and get the page to open with the passed data automatically filled in on the page's form. This has solved my problem. Regards and thanks again for the input DaveO --------------------------------------------------- "Larry Serflaten" <serflaten@usinternet.com> wrote in message news:OOog03%23oEHA.3460@tk2msftngp13.phx.gbl... "DaveO" <jsinvest@mweb.co.za> wrote > Hi Larry > > Thanks for the feedback. > > However, I feel that I do need to open the web page and fill in the text in > the text box, as my app is to open the web page and fills in some info and > the user needs to fill in other text fields before they subit the web page / > form. Give them a form to fill in the other info, and then pass it all on to the server. You might also try filling the form in the call, for example, you want to add the user's name, (Your Name Here) http://www.google.com/advanced_sear...r%20Name%20Here Go there, and see that the form has "Your Name Here" in the top textbox.... LFS
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.