[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1517
  • Last Modified:

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
0
aib_it
Asked:
aib_it
  • 2
1 Solution
 
jpaulinoCommented:
>> 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
 
jpaulinoCommented:
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

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now