This looks like it should work to me. The WriteTextFile part should loop through the listbox and write all of the items to a textfile. The ReadTextFile part should read the textfile and loop through adding each item to the combobox. This has worked somewhat, but all I get in my combo box on the Read part is "False". Is this because m is not dimmed as a string? Here's the events:
VB Code:
  1. Public Sub ReadTextFile()
  2.  
  3.  Dim lngFileNo As Long
  4.     Dim str As String
  5.    
  6.     MusicMaster.ComboCategory.Clear
  7.     lngFileNo = FreeFile
  8.    
  9.     Open "C:\Windows\System\categories.kmo" For Input As lngFileNo
  10.    
  11.     Do While Not EOF(lngFileNo)
  12.         Line Input #lngFileNo, str
  13.         MusicMaster.ComboCategory.AddItem str
  14.     Loop
  15.    
  16.     Close lngFileNo
  17.    
  18.    
  19. End Sub
  20.  
  21. Public Sub WriteTextFile()
  22. 'Save the listbox entries to a text file
  23.     Dim l As Integer
  24.     Dim m As Integer
  25.     'get the next free file
  26.     l = FreeFile
  27.     Open "C:\Windows\System\categories.kmo" For Output As #l
  28.    
  29.     'start the loop
  30.     For m = 0 To categories.lstCategories.ListCount - 1
  31.         'add to the file every line from the listbox
  32.         Print #l, categories.lstCategories.Selected(m)
  33.    
  34.        
  35.     Next m
  36.    
  37.     Close #l
  38.  
  39. End Sub

I've never had this much trouble writing to a text file before. Any help appreciated.