Greeting,
I sometimes have a problem with the code below. Sometimes it returns a strange error depending on the content I want to pass to the Textarea element of a webpage.
Sometimes, depending on the content of the SubItem, exp.Message is "Exception from HRESULT: 0x800A0259".Code:HtmlDocument DOC = this.webBrowser1.Document; foreach (ListViewItem lvi in lvFieldsCopying.Items) { if (lvi.SubItems[2].Text != "") { HtmlElementCollection oHtmlElements = DOC.GetElementsByTagName("textarea"); foreach (HtmlElement textarea in oHtmlElements) { if (textarea.Name == lvi.SubItems[2].Text) { //MessageBox.Show(lvi.SubItems[1].Text); try { textarea.InnerHtml = lvi.SubItems[1].Text.ToString(); } catch (Exception exp) { MessageBox.Show("Could not copy your field to the site field: " + exp.Message); } } } } }
Did someone run into this already?




Reply With Quote