There is not much text in a HTML page.
All between the <HTML>begin and end tag is called innertext and including
that it is called outertext.
However that is probably not what you are after.
When you want the HTML innertext you can use MSHTML to get that.
However keep in mind that that is the complete web page (for outertext
without in newer situation the first line) including all tags. What is text
is not easy to determinate, because it is all what is written between an
begin and an end tag (not inside a tag), while it can as well be done using
JavaScript.
mshtml
http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/hosting/host
ing.asp
I hope this helps a little bit.
Cor
[re capturing text in a browser window]
>All between the <HTML>begin and end tag is called innertext and including
>that it is called outertext.
>
>However that is probably not what you are after.
>When you want the HTML innertext you can use MSHTML to get that.
I confess that I haven't gone after the innertext yet cause I need
some whitespace stuff that's probably relegated to outer text, like
<nbsp> etc. If I could do the equivalent of sending in a ^A^C
(select-all, capture), I'd be home free. I thought there would
probably be a simple way to do that. I haven't seen that done before
though, so it's probably not easy.
Thanks for your reply, Cor.
Mark Bennion - 29 Dec 2004 04:55 GMT
First time on this site (didn't even know it existed!)... My question has
similarities to the latest post. I was going to pose a new question, but
something wasn't working. Ultimately I will want to copy text from an HTML
window, just as the latest post posed. But before that, I want to figure out
how to display a menu bar on my HTML window. My user is quite happy with my
solution of using MSHTML and the function ShowHTML() to display records from
an Access database containing HTML. But it is also desired to print or copy
the data in the window. It has been quite some tiome since I wrote the
application so my memory is hazy. But I remember spending quite some time in
futility trying to figure out how to also have a menu with my ShowHTML
window. I am using C++ in Visual Studio.net.
Thanks,
Mark
> [re capturing text in a browser window]
>
[quoted text clipped - 12 lines]
>
> Thanks for your reply, Cor.
Jeff Gaines - 29 Dec 2004 09:33 GMT
> [re capturing text in a browser window]
>
[quoted text clipped - 12 lines]
>
> Thanks for your reply, Cor.
I use the following to copy text from the DHTML edit control to a
RichEdit control if it's any use:
private void JConvertHTM2RTF(string strFQSource)
{
object obfile = new object();
object ob = new object();
obfile = strFQSource;
axDHTMLEdit1.NewDocument();
axDHTMLEdit1.LoadDocument(ref obfile, ref ob);
rtfDest.Text = "";
axDHTMLEdit1.Focus();
SendKeys.SendWait("^a^c");
rtfDest.Focus();
SendKeys.SendWait("^a^v");
}

Signature
Jeff Gaines
Posted with XanaNews 1.17.1.2 http://www.wilsonc.demon.co.uk/delphi.htm