Public Sub LoadLstCboFromFile(ByRef oObj As Object, sPath As String, Optional bClear As Boolean = True)
' oObj doit être une ListBox ou un ComboBox n'étant pas en lecture seule
Dim FF As Integer, sLine As String
FF = FreeFile
If bClear Then oObj.Clear
If LenB(Dir(sPath, vbSystem Or vbHidden)) > 0 Then
Open sPath For Input As #FF
Do Until EOF(FF)
Line Input #FF, sLine
If LenB(sLine) > 0 Then oObj.AddItem sLine
Loop
Close #FF
End If
End Sub
Public Sub SaveLstCboToFile(ByRef oObj As Object, sPath As String)
' oObj doit être une ListBox ou un ComboBox
Dim FF As Integer, i As Integer
FF = FreeFile
Open sPath For Output As #FF
For i = 0 To oObj.ListCount - 1
Print #FF, oObj.List(i)
Next
Close #FF
End Sub