12 Декабрь 2008

Как сохранить текст из ListBox в файл?

ListBox |  Таги: ,

Как сохранить текст из ListBox в файл?

Option Explicit
Dim Text As String
Dim i As Byte
Dim FileNum As Integer
Dim FName As String

Private Sub Form_Load()
Dim bytC As Byte
For bytC = 1 To 10
    List1.AddItem Format$(bytC, "00")
Next
For i = 0 To List1.ListCount - 1
    Text = Text & List1.List(i) & vbCrLf
Next
FileNum = FreeFile
Open App.Path & "\Text.txt" For Append As #FileNum
    Print #FileNum, Text
Close #FileNum
End Sub


Оставить комментарий

Я не робот.