Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Control eh?
Message
From
05/11/2010 07:45:15
 
 
To
04/11/2010 16:47:17
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
01488307
Message ID:
01488366
Views:
108
>>The KEYBOARD command puts keystrokes into VFP buffer. An ActiveX control wouldn't see them. What are you trying to accomplish?
>>
>>
>>>The first two lines of code below work fine. I am not sure why the displayed website is not being selected by the CTRL A. Have I blundered?
>>>
>>>THIS._Webbrowser41.NAVIGATE2('http://www.google.com')
>>>
>>>THISFORM.REFRESH
>>>
>>>KEYBOARD"{CTRL+A}"
>
>I am trying to capture the text from a web page and eventually write it to a memo field

Hey Grady. I created a web page called w1.htm in folder c:\demos, with the source (note the spaces after < and before > are intentional, so I can embed the HTML source in a UT post).

< html >
< body >
< input id="test" type="text" >
< /body >
< /html >

Below is sample code you can try by executing line by line in the Command Window, which opens that web page above, sets the value of the text field (in case you want to know how to read/write to the value of fields), and then sets cHTML to the entire HTML of the web page.

o=NEWOBJECT("_webform",HOME()+"gallery\_webview")
o.Show
o.oleWebBrowser.Navigate2("c:\demos\w1.htm")
o.oleWebBrowser.document.getElementByID("test").innerText="Testing 123"
cHTML=o.oleWebBrowser.document.body.outerHTML

Tip. If you want to run VFP code to occur after a web page is loaded after calling Navigate2(), then put your event code in the NavigateComplete() event method of oleWebBrowser, which fires after the web page is full loaded into the IE web browser control.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform