Load a List box with Lines from a File
Category:Files and Directories
Version Compatibility: Visual Basic 6, Visual Basic 5
This simple routine loads a list box from a file... (except blank lines). I was using it to read in a list of directories created using DIR /S /B >> FILENAME.TXT for comparison. There should be other uses for it too. 'SAMPLE USAGE... Sub Command1_Click 'This Example Expects a list box called LstElements 'and a File called C:\TEMP\TEST.TXT LoadListFromFile LstElements, "C:\TEMP\TEST.TXT" End Sub
Instructions: Copy the declarations and code below and paste directly into your VB project.