# [SOLVED] [VB6] Multi Line Textbox Input &amp; Multi Line Texbox Output



## MrPonos (Dec 21, 2008)

Hi everyone, i have searched the forum but have not been able to find a solution as to what i need to acheive.


What i want to do is have 2 Multi line textboxes.

In the first textbox i want to be able to paste multiple urls.
Example:
url1
url2
url3
url4
etc etc..

and in the second textbox i would like the output to go like this:

<a href=URL1 target=blank>Link1</a>
<a href=URL2 target=blank>Link2</a>
<a href=URL3 target=blank>Link3</a>
<a href=URL4 target=blank>Link4</a>


So far all ive gotten is this


```
Private Sub Command1_Click()
 Dim l As Integer
    Text2.Text = ""
    For i = 1 To Len(Text1.Text)
        l = InStr(i, Text1.Text, vbNewLine)
        If l <> Len(Text1.Text) And l <> 0 Then
            strProperties = Mid(Text1.Text, i, (l - i))
            strProperties = "<a href=" & strProperties & " target=blank>Link 1</a>"
            Text2.Text = Text2.Text & strProperties & vbNewLine
        Else
        If l = 0 Then
            strProperties = Mid(Text1.Text, i, ((Len(Text1.Text) + 1) - i))
            strProperties = "<a href=" & strProperties & " target=blank>Link 1</a>"
            Text2.Text = Text2.Text & strProperties & vbNewLine
            Exit For
        Else
            Exit For
        End If
        End If
        i = l + 1
    Next i
   
  If Text1.Text = "" Then
  MsgBox ("Add some links!")
   
  End If

End Sub
```
This code outputs the links like this:

```
<a href=url1 target=blank>Link 1</a>
<a href=url2 target=blank>Link 1</a>
<a href=url3 target=blank>Link 1</a>
<a href=url4 target=blank>Link 1</a>
```
But what i need to acheive is:

```
<a href=url1 target=blank>Link1</a>
<a href=url2 target=blank>Link2</a>
<a href=url3 target=blank>Link3</a>
<a href=url4 target=blank>Link4</a>
```
As you see with each url outputted into textbox 2 the Link number changes.

Can someone please help me here i really dont know what to do, my efforts so far have just mess up the output of the links :sigh:

Regards.


----------



## MrPonos (Dec 21, 2008)

*Re: [VB6] Multi Line Textbox Input & Multi Line Texbox Output*

I got it resolved. Thanks anyway.


----------

