1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Help with Visual Basics

Discussion in 'Software Development' started by spedster, Dec 18, 2001.

Thread Status:
Not open for further replies.
  1. spedster

    spedster Thread Starter

    Dec 13, 2001
    I want to make a form that will have a RichTextBox and a webbrowser on it and then have the browser in the background not seen and pulll the text off of that webpage that opens up and put it to the textbox. I have tried the getwindowtext command and that didn't seem to work. If anyone knows how to do that and or how to just make the richtexbox display that text from the page without having the browserr control on the form please let me know how I can do that.


  2. FirstBorn


    Mar 24, 2003
    If you want the textbox to display the text of the content of the webbrowser, use either of these:
    (Choose 1 and Test for best results)

    Text1.Text = Webbrowser1.Document.Body.InnerText
    Text1.Text = Webbrowser1.Document.Body.outerText
    Text1.Text = Webbrowser1.Document.DocumentElement.InnerText
    Text1.Text = Webbrowser1.Document.DocumentElement.OuterText

    You can also use the following:
    Create an IHTMLTextRange:
    (don't forget to go to Project --> References, Make sure that Microsoft HTML Object Library has been checked)

    Dim TxtRng as IHTMLTxtRange

    Do While WebBrowser1.ReadyState <> READYSTATE_COMPLETE

    Set TxtRng = WebBrowser1.Document.body.createTextRange
    Text1.Text = TxtRng.Text

    If you want the RichTextBox to display the WebPage's Text, then replace Text1.Text with RichTextBox1.Text.

    Hope This Helps!

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/62229

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice