VBA, not VB6? If the version of VBA offers a FileList control, you can use that. Set the path and pattern properties, as needed, during runtime. Otherwise, you can use the Dir$() function -- think it is in all VBA versions. Populate a normal listbox with the results:
Code:Dim sFile As String sFile = Dir$("[path]\*.*", vbNormal Or vbHidden Or vbSystem or vbReadOnly or vbArchive) Do Until sFile = "" List1.AddItem sFile sFile = Dir$() Loop




Reply With Quote