# Visual Basic > Visual Basic .NET > VS 2010 How to save textbox text to notepad and save again a textbox text to add it into the

## maxtertj

Using VB net.

I want to save my textbox1.text in a notepad of my computer. And after saving that, I will save the next textbox1.text again. But I want it to be added to the same notepad. Anyone can help me on the code? 

I have a one form with controls and all entries will be displayed on one textbox. I want to save that textbox but I don't know how.

----------


## .paul.

For the first save...



```
Dim theText As String = TextBox1.Text
IO.File.WriteAllText("c:\theFolder\myText.txt", theText)
```

For the append...



```
theText = TextBox2.Text
IO.File.AppendAllText("c:\theFolder\myText.txt", Environment.NewLine & theText)
```

----------


## maxtertj

Is that going to be like this?



```
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        Dim theText As String = txtdisplay1.Text
        IO.File.WriteAllText("c:\theFolder\myText.txt", theText)
    End Sub

    Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
        Dim theText As String
        theText = txtdisplay1.Text
        IO.File.AppendAllText("c:\theFolder\myText.txt", Environment.NewLine & theText)
    End Sub
```

Please correct me if I'm wrong.

----------


## .paul.

> Is that going to be like this?
> 
> 
> 
> ```
> Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
>         Dim theText As String = txtdisplay1.Text
>         IO.File.WriteAllText("c:\theFolder\myText.txt", theText)
>     End Sub
> ...


You got it... You do realise you can test any code you're unsure of?

----------


## maxtertj

Thank you. I know now how it works now.

But do you know how can I create file without inputing the path address in a textbox or in a code?
What I mean is when I click a button, it will open a document folder then, from there, I will create or choose a txt file where I want to save my textbox.text

Can you help me with this?

----------


## .paul.

http://www.scproject.biz/Using%20Dialogs.php#bm3

----------

