I have embedded a webbrowser into my Excel XP document, and have created the appropriate Home, back, forward, etc buttons to control it. It works nicely. However, I am having problems getting the formated text from the web page into my Excel sheet. I would like for it to automatically paste the text onto the Excel sheet in the same format used on the web page. The page has several tables, and text color is important.
I tried using worksheets("sheet1".range("a1" = WebBrowser.Document.documentelement.outertext, but that only puts the entire web page text into cell A1. Using range("a1:z50" puts the entire web page text into cells A1:Z50.
I have also tried using a RichTextBox, but the entire page doesn't display in the box, instead only the first portion of the page appears. The other problem with the RichTextBox is that the text loses its color, which leads me to beleive that .documentelement.outertext will only provide the text and not the formatting.
I could just require the user to physically copy and paste the page to sheet, but thats not a very elegant solution.
I tried using worksheets("sheet1".range("a1" = WebBrowser.Document.documentelement.outertext, but that only puts the entire web page text into cell A1. Using range("a1:z50" puts the entire web page text into cells A1:Z50.
I have also tried using a RichTextBox, but the entire page doesn't display in the box, instead only the first portion of the page appears. The other problem with the RichTextBox is that the text loses its color, which leads me to beleive that .documentelement.outertext will only provide the text and not the formatting.
I could just require the user to physically copy and paste the page to sheet, but thats not a very elegant solution.