Hey all!
I need to open a folder, loop through it, grab all the .XFC files, load them into my app, then loop through hte loaded files and do something with each one of them? Anyone know how to do this?
Printable View
Hey all!
I need to open a folder, loop through it, grab all the .XFC files, load them into my app, then loop through hte loaded files and do something with each one of them? Anyone know how to do this?
VB Code:
Dim sDirectory As String, sFilename As String, sFilepath As String Dim lFilenum As Long sDirectory = "C:\" 'Get the first matching file sFilename = Dir$(sDirectory & "*.xfc") Do While Len(sFilename) > 0 sFilepath = sDirectory & sFilename lFilenum = FreeFile 'Open the file Open sFilepath For Input As #lFilenum 'Now do whatever you want to do with the files 'bla bla bla 'Close the file Close #lFilenum 'Get the next matching file sFilename = Dir$ Loop
How do I get the text into a variable? Thanks.
VB Code:
'Open the file Open sFilepath For Input As #lFilenum 'Read stuff into Buffer Buffer = Input(LOF(lFilenum), lFilenum) 'Now do whatever you want to do with the files 'bla bla bla 'Close the file Close #lFilenum