|
-
Dec 2nd, 2004, 02:29 AM
#1
Thread Starter
Hyperactive Member
HElp Needed
Hi,i load a list box with the a list of names in,how could i save all those names one by one to diffrent txt files file thanks!
-
Dec 2nd, 2004, 02:37 AM
#2
you want each name to a different file ?, if so try this.
VB Code:
Dim i As Integer
For i = 0 To List1.ListCount - 1
Open "C:\Name" & i + 1 & ".txt" For Output As #1
Print #1, List1.List(i)
Close #1
DoEvents
Next i
casey.
-
Dec 2nd, 2004, 03:31 AM
#3
Frenzied Member
In case you want to save them in the same folder your application is:
VB Code:
Dim i As Long
For i = 0 To List1.ListCount - 1
Open App.Path & "\" & List1.List(i) & ".txt" For Output As #1
Print #1, List1.List(i)
Close #1
DoEvents
Next
I just made some changes to vbasicgirl, I hope she doesn't mind.
If you want them all in just one file:
VB Code:
Dim i As Long
Open App.Path & "\" & List1.Name & ".txt" For Output As #1
For i = 0 To List1.ListCount - 1
Print #1, List1.List(i)
Next
Close #1
We miss you, friend...  Rest in Peace, we will take care of the rest of it.
[vbcode]
On Error Me.Fault = False
[/vbcode]
- Silence is the human way to share ignorance
Tec-Nico
-
Dec 2nd, 2004, 03:43 AM
#4
I think he wanted different files.
-
Dec 2nd, 2004, 11:31 AM
#5
Thread Starter
Hyperactive Member
yeh i want it to say every diff name to a diff txt files like there 5 names so there be 5 txt files cheers :P
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|