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

    Joined:
    Dec 13, 2001
    Messages:
    9
    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.

    Thanks

    Ted
     
  2. FirstBorn

    FirstBorn

    Joined:
    Mar 24, 2003
    Messages:
    6
    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)

    Declarations:
    Dim TxtRng as IHTMLTxtRange

    Command1_Click()
    Do While WebBrowser1.ReadyState <> READYSTATE_COMPLETE
    DoEvents
    Loop

    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!

Loading...
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