I have a rich textbox, how do I save the data/text in the textbox?
You must truly hate your computer:-)
I think I got an idea that might work. We'll start by helping you save to .txt and we'll discuss the rest. Everyone please throw your hat, I am not sure hw far I can go with this:
(1) When you load text to say 'Text1.Text', have it saved on your machine as .txt
-
-
Private Sub STORE_ME_Click()
-
-
Open App.Path + "\SaveThisFile.txt" For Append As #1
-
-
Write #1, , Text1.Text
-
-
Close #1
-
-
Text1.Text = ""
-
-
End Sub
-
-
Have your Form_Load look for this text in that file. When file loads back to your application:
(2) Tell Form_Load to add it in Text1.Text
Form_Load Code
-
-
Private Sub RETURN_ME_Click()
-
-
Dim FileLine As String
-
-
Open App.Path + "\SaveThisFile.txt" For Input As #1
-
-
Do While Not EOF(1)
-
Input #1, FileLine
-
If FileLine$ <> "" Then
-
Text1.Text = FileLine
-
End If
-
Loop
-
Close #1
-
-
-
End Sub
-
-
Now if that works, and you can see data in Text1.Text. You can try saving and retrieving as bttf. Here's the problem, you can modify the code to save as the file extension of your choice, but Windows does not seem to know how to open the file as bttf. Unless you tell VB:
(3) SaveThisFile.txt = SaveThisFile.bttf, therefore to load the file
Hence:
-
-
Open App.Path + "\SaveThisFile.bttf" For Append As #1
-
-
Form_Load (Step 2)
-
-
Private Sub RETURN_ME_Click()
-
-
Dim FileLine As String
-
-
Open App.Path + "\SaveThisFile.bttf" For Input As #1
-
- SaveThisFile.bttf = SaveThisFile.txt
-
-
Do While Not EOF(1)
-
Input #1, FileLine
-
If FileLine$ <> "" Then
-
Text1.Text = FileLine
-
End If
-
Loop
-
Close #1
-
-
-
End Sub
-
-
I am not sure how this makes logical sense or whether, it can work, VB is not installed here cannot run it. Give me sometime to look through it again on my notebook. Please throw your hat in, Scripts Members.
Dököll