Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

saving a multiline textbox to a txt file

Status
Not open for further replies.

pbuddy2007

Technical User
Feb 9, 2008
17
0
0
CA
I'm using the following code to save the textbox:

Text144.Text = ""


strtxt = Text14.Text
arrlines = Split(strtxt, vbCrLf)

For Each strline In arrlines
Text144.Text = Text144 & strline & vbCrLf
Next


FileNum = FreeFile
Open App.Path & "\temp\file.jfl" For Output As FileNum
Print #FileNum, Text144.Text
Close FileNum


the problem is that each time i load + save the text I get an extra vbCrtl at the end, how can i delete them all ?
 
mystr = Text144.Text

MyArray = Split(mystr, vbCrLf)

deCh= FreeFile
Open App.Path & "\temp\file.jfl" For Output As deCh
For i = 0 To UBound(MyArray )
mystr = MyArray (i)
Print #deCh, mstr
Next
Close #deCh
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top