'----------------------Combo Box-----------------------------
Public Sub SaveList(fileName As String, List As ComboBox)
On Error Resume Next
Dim lngSave As Long
If fileName$ = "" Then Exit Sub
Open fileName$ For Output As #1
For lngSave& = 0 To List.ListCount - 1
Print #1, List.List(lngSave&)
Next lngSave&
Close #1
End Sub
Public Sub LoadList(fileName As String, List As ComboBox)
If fileName = "" Then Exit Sub
Dim lstInput As String
On Error Resume Next
Open fileName$ For Input As #1
While Not EOF(1)
Input #1, lstInput$
If lstInput$ = "" Then Exit Sub
List.AddItem lstInput$
Wend
Close #1
End Sub
'------------------List Box----------------------------------------
Public Sub List_Save(TheList As ListBox, fileName As String)
'Save a listbox as FileName
On Error Resume Next
Dim save As Long
Dim fFile As Integer
fFile = FreeFile
Open fileName For Output As fFile
For save = 0 To TheList.ListCount - 1
Print #fFile, TheList.List(save)
Next save
Close fFile
End Sub
Public Sub List_Load(TheList As ListBox, fileName As String)
'Loads a file to a list box
On Error Resume Next
Dim TheContents As String
Dim fFile As Integer
fFile = FreeFile
Open fileName For Input As fFile
Do
Line Input #fFile, TheContents$
Call List_Add(TheList, TheContents$)
Loop Until EOF(fFile)
Close fFile
End Sub
Public Sub List_Add(List As ListBox, txt As String)
List.AddItem txt
End Sub