0

I have a WebBrowser control and I will like to get all the text from that control. In other words I will like to get the same text that if I where to grab my mouse select everything from the browser and paste it in notepad. I know there are several techniques to get the text such as WebBrowser.DocumentText or innerhtml but none of those techniques gives the same text that I would get if I where to copy everything from the browser to the clipboard.

Tono Nam
  • 34,064
  • 78
  • 298
  • 470
  • I think there is diffrent charset in WebBrowser.DocumentText and you can say it to WebBrowser.DocumentText to get your needed charset – ahmadali shafiee Dec 20 '11 at 04:42

1 Answers1

4

This should work:

webBrowser1.Document.ExecCommand("SelectAll", false, null);
webBrowser1.Document.ExecCommand("Copy", false, null);    
AVee
  • 3,348
  • 17
  • 17