File Iteration

Animaul
09-28-2004, 09:24 AM
The company I work for is in starting a huge data migration effort. To help in the migration I have been asked to iterate through a directory of word doc's, open each one and save it as a text file.

My problem is I do not know how to iterate through the files in a directory. I have read that I have to do this through kernal function calls. Is that so? And if so what function do I start with?

Thanks,

Animaul

jjStinger72
09-28-2004, 10:04 AM
First... ..

second... Dir$ (check msdn for a full disertation)



Private Sub IterateThroughFolder()

Dim lsFileName As stirng

lsFileName = Dir$("C:\Temp\*.doc")

Do While LenB(lsFileName) <> 0

Debug.Print lsFileName

'get the next one
lsFileName = Dir

Loop

End Sub


Second - Alternate API Method...
FindFirstFile
FindNextFile

herilane
09-28-2004, 10:05 AM
Use Dir().
http://www.xtremevbtalk.com/showthread.php?t=5050

Animaul
09-28-2004, 10:36 AM
Thanks. I knew there had to be an easier way then going through the kernal. Thanks for pointing me to the tutorial. I searched the forums but not the tutorials.

Thanks Again,

Animaul

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum