Opening Word in WebBrowser control and selecting some text
-
Hi everybody. I open a Word document in the web browser control, I then select some text in it using a mouse, and I want to paste the selected text into another text box on the same form, but it does not work. The code looks like this: Clipboard.SetDataObject(""); _web.Focus(); _web.ExecWB(SHDocVw.OLECMDID.OLECMDID_COPY, SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER,ref refmissing , ref refmissing); IDataObject iData = Clipboard.GetDataObject(); if(iData.GetDataPresent(DataFormats.Text)) { textBox2.Text = (String)iData.GetData(DataFormats.Text); } It is as if the selected text gets copied somewhere else. I did an extensive search on the web, but to no avail. Sending keys to the browser control will get no results, like: _web.Focus(); SendKeys.Send("^c"); Nothing in the clipboard aftert that operation either. Thanks a lot. Sarajevo, Bosnia