Here's what I am trying to do: Select text from a webpage I pulled up using my web browser control. After clicking a button while this text is still selected I would like a message box to pop-up displaying the text that was highlighted by the user. I do I get this functionality to work in my wpf application?
I think I'm on the right track using mshtml but I get an error that says:
Error HRESULT E_FAIL has been returned from a call to a COM component.
This erroe will happen even when I try something small on the document like changing the title.
The code is below:
IHTMLDocument2 doc = (IHTMLDocument2)this.webBookText.Document; doc.title = "l";