+ Reply to Thread
Results 1 to 3 of 3

display text multiline which consist empty lines in between - in a textbox on a userform

Hybrid View

Lkivagten display text multiline which... 12-30-2012, 10:20 PM
Kiran.Sunkara Re: display text multiline... 12-31-2012, 05:06 AM
Kiran.Sunkara Re: display text multiline... 01-05-2013, 12:42 AM
  1. #1
    Registered User
    Join Date
    07-24-2012
    Location
    Denmark
    MS-Off Ver
    Excel 2003
    Posts
    69

    display text multiline which consist empty lines in between - in a textbox on a userform

    Hi guys

    I have been trying to figure this out for several hours by now but im still stuck.

    I will try to keep it simple:

    i have a userform 1 with a commandbutton on top. When i press this button i want to open userform 2 which has a textbox1 on it and instantly load/display some text from a textfile to the textbox1 - the textfile got empty lines in between textlines.

    the textfile is placed at : ActiveWorkbook.Path & "\Data\Tekst\Diverse tekst\ekstra toiletter.txt"

    So far i have only been able to get the first line of text shown ,, if any.

    How do i solve this?

    Thanks in advance for any help or guidance to my problem.

    /Jan

  2. #2
    Registered User
    Join Date
    12-21-2012
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    69

    Re: display text multiline which consist empty lines in between - in a textbox on a userfo

    See if this helps:

    Private Sub CommandButton1_Click()
    Dim fso As FileSystemObject
    Dim ts As TextStream
    
    TEXT_FILE_PATH = ActiveWorkbook.Path & "\Data\Tekst\Diverse tekst\ekstra toiletter.txt"
    
    Set fso = New FileSystemObject
    Set ts = fso.OpenTextFile(TEXT_FILE_PATH)
    
    Me.TextBox1.Text = ts.ReadAll
    
    ts.Close
    Set ts = Nothing
    Set fso = Nothing
    
    End Sub
    Hope this helps.
    Kiran

  3. #3
    Registered User
    Join Date
    12-21-2012
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    69

    Re: display text multiline which consist empty lines in between - in a textbox on a userfo

    Did it help?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1