Reading Each line in string or text box

Hi,
I have an application which uses a class to create pdf documents  from a text box. But the class required that each line should be inserted separately as:

  objpdf.PDFTextOut line, 1, 1
  objpdf.PDFTextOut "lin2", 1, 2
  objpdf.PDFTextOut "line 3", 1,3

If I use objpdf.PDFTextOut text1.text command now it reads only the first line of text1.text not the rest.

Now I want a mechanism which can read each line of text1.text.

Can any one help me in this regards

Thanks
aib_itAsked:
Who is Participating?
 
Jorge PaulinoConnect With a Mentor IT Pro/DeveloperCommented:
Opps! It's VB6
 

    Dim line As Variant
    Dim lines() As String
    lines = Split(Me.TextBox1.Text, vbNewLine)
    
    For Each line In lines
      Debug.Print line
    Next

Open in new window

0
 
Jorge PaulinoIT Pro/DeveloperCommented:
>> Now I want a mechanism which can read each line of text1.text.
Try this way:


        For Each line As String In Me.TextBox1.Lines
            Debug.WriteLine(line)
        Next

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.