Click to See Complete Forum and Search --> : Selecting all text from webbrowser control?


January 23rd, 2000, 09:41 PM
I am trying to make an internet browser that integrates the microsoft agent control. I want the character to read any text on the web page I load. Right now the user has to hit control A, then control C, then hit a Read Page button.
I copy the text from the clipboard into an invisible text box he reads from.

My question is, is there anyway to select all text from a webbrowser object? If I can figure this out, I can automate the rest myself.

I hope you can help,

Thanks,

Tony

Aaron Young
January 23rd, 2000, 10:29 PM
You can use the Document.Body Object to Extract all the Text on the Webpage, (as it reads, non-HTML Tags), ie.

private Sub Command1_Click()
WebBrowser1.Navigate "www.redwingsoftware.com"
End Sub

private Sub WebBrowser1_DocumentComplete(byval pDisp as Object, URL as Variant)
Text1 = WebBrowser1.Document.Body.innerText
End Sub




Aaron Young
Analyst Programmer
ajyoung@pressenter.com
aarony@redwingsoftware.com

January 24th, 2000, 04:30 PM
Thanks a million, works perfect.


Tony