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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Resave from ListBox to txt File is adding quotes 1

Status
Not open for further replies.

Bubbler

IS-IT--Management
Dec 14, 2003
135
US
I am using a text box and a cmd button and a list box to add items to a txt file but when it resaves the entries to the txt file it adds quotes on each entry, so if the list was:
entry1
entry2
and I added entry3 the list resaves as
"entry1"
"entry2"
"entry3"

What am I missing?



If txtAdd.Text > "" Then
'add txtAdd's entry to the listbox
LstSites.AddItem txtAdd

'Then resave the listbox to the txt file
fname = App.Path & "\filtered.txt"

Open fname For Output As #1
For N = 0 To LstSites.ListCount - 1
temp = LstSites.List(N)
Write #1, temp
Next N
Close #1
Exit Sub
End If
 
Hi

Try using Print #,temp

instead of Write #,temp


Write # inserts quotes into your Data.

good luck

Bob
 
Thx tudogs, that's what it was. I didn't know you could use Print# for this function.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top