Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Read text from notepad

Status
Not open for further replies.

nnuswantari

Programmer
Nov 21, 2009
17
ID
Dear friends,
I use a control 'WebBrowser' in VB.net. I want to display some textline. I will write this text line in a notepad. And then I will display to my WebBrowser. Could you tell me, How do I, so I can call/read this textline (in notepad) to my WebBrowser?
Thanks for your help.[love][smile]

 
Where is this text suppost to be place in the webbrowser?

If at first you don't succeed, then sky diving wasn't meant for you!
 
Exp:
Code:
  Public Function DisplayWB() As String
        Dim htText As String = ""
        htText &= "<Table align=center width='90%' border=0>" & vbCrLf
        htText &= "<tr>" & vbCrLf
        htText &= "<tr><td>&nbsp;</td></tr>" & vbCrLf                                 
        htText &= "<td><b> Hello,Nuswantari, welcome to our system. Now, you will very confuse...bla..bla..bla</b></td>" & vbCrLf
        htText &= "<td width=20%>&nbsp;</td></tr>" & vbCrLf
        htText &= "</tr>" & vbCrLf
        Return htText
    End Function
I want to write Hello,Nuswantari, welcome to our system. Now, you will very confuse...bla..bla..bla in notepad. Then I will call this statement from our html sintax.
 
I didn't find that your last post was all that clear. Although, based on your reponse, you seem like you want to load an existing page using the web browser, read the text from notepad and modify the page so that your text will actually appear on the loaded webpage.

If this is correct then you will most likely need VB script or Java script to accomplish your goal.

If at first you don't succeed, then sky diving wasn't meant for you!
 
Is this what you want?
Code:
        AppActivate("Untitled - Notepad")
        My.Computer.Keyboard.SendKeys("Hello,Nuswantari, welcome to our system. Now, you will very confuse...blah..blah..blah")
Note that if you have multiple notepads open this will fail unless the text file has already been saved giving Notepad a unique title. You can iterate through all of the open notepad processes or have your program start notepad itself and hang on to the process id for that notepad.

-I hate Microsoft!
-Forever and always forward.
-My kingdom for a edit button!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top