Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Control eh?
Message
From
08/11/2010 14:17:18
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
01488307
Message ID:
01488532
Views:
86
* I've tried quite a few ways to get this done, with no luck so for
* I need to paste the selected web page into a General field and it's not happening
* The most recent attempt is below and resides in _WEBBROWSER41.NAVIGATECOMPLETE2

LPARAMETERS pdisp, url
USE masterdata
#define OLECMDID_SELECTALL 17
THIS.ExecWB(OLECMDID_SELECTALL, 0)
APPEND BLANK
replace captured WITH DATETIME()
BROWSE FIELDS WEBPAGE
#define OLECMDID_PASTE 17
THIS.ExecWB(OLECMDID_PASTE, 0)










>>>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.
I ain't skeert of nuttin eh?
Yikes! What was that?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform