Here's some code to show you how to save some combo items to a file. This could be useful when creating a find history or favourites combo box. Please see 'Loading combo items from a file' for the code to re-load the data.
Private Sub SaveItems()
Dim filenum As Integer
Dim i As Integer
filenum = FreeFile '// Get a free file number
Open App.Path & "items.txt" For Output As filenum '// open
the file
For i = 0 To Combo1.ListCount - 1
Print #filenum, Combo1.List(i) '//
write each item to the file
Next
Close filenum '// Close the file
End Sub
Comments