Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MS Browser control - get text without HTML
Message
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
01542239
Message ID:
01542245
Views:
52
>>I'm working with the ActiveX browser control that comes with VFP. I can retrieve blocks from the Document object by ID or user selected range. Is there something that will return just text without the HTML markup? It seems to me that if only text can be displayed in the browser I should be able to read it without the HTML.
>>Thanks
>
>AFAIK there is InnerText property in that control.

Borislav,
many thanks for the help. Could you help me a bit more?
Sample 1 and Sample 2 below work but:
If I use oBrowser.document.getElementById() innerText works
If I use oBrowser.document.Selection() innerText does not work
What do I need to change to make innerText work with .Selection()

Thanks, John
* SAMPLE 1  && THIS WORKS
* ------------------------------
loRange = This.oBrowser.document.getElementById("SB5A9I3X7J0")
wait window  loRange.innerText

* SAMPLE 2 && THIS WORKS
* ------------------------------
loSelection = This.oBrowser.Document.Selection()
loRange = loSelection.CreateRange()
*
IF TYPE([loRange.htmlText])=[C]
  wait window loRange.htmlText
ENDIF

* SAMPLE 3 && THIS DOES NOT WORK
* ------------------------------
IF TYPE([loRange.innerText])=[C]
  wait window loRange.innerText
endif
Beer is proof that God loves man, and wants him to be happy. - Benjamin Franklin
John J. Henn
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform