[AccessD] Zipping files in "subfolders" through Access

Lonnie Johnson prodevmg at yahoo.com
Fri Apr 1 09:44:37 CST 2005


I've used the following to zip files from a particualar location. It works fine. Now I want to use it on a folder where all the files are in subfolders. I can't seem to tweek it. Has anyone done this before?

Function ZipIt()
 
Dim i As Integer
Dim strFileLoc As String
strFileLoc = "C:\Tables\"
Dim strAppName As String
Dim strZipFile As String
Dim strTargetFiles(1500) As String
Dim strDirPath As String
Dim NewZip As String
 
strDirPath = Dir(strFileLoc & "*.*")
 
Do While strDirPath <> ""
strTargetFiles(i) = strDirPath
strDirPath = Dir
i = i + 1
Loop
 
NewZip = "C:\BackUp\Tables\" & Format(Now(), "yyyy-mm-dd-hh-mm") & "-Tables.zip"
 
'Location of zip executable
strAppName = "C:\Program Files\WinZip\WINZIP32.EXE"
'
Name of new zipfile.
strZipFile = NewZip
 
'Zipping proceess
Call Shell(strAppName & " -A " & """" & strZipFile & """" & " " & """" & strFileLoc & strTargetFiles(i) & """", 1)




May God bless you beyond your imagination!
Lonnie Johnson
ProDev, Professional Development of MS Access Databases
Visit me at ==> http://www.prodev.us





 





		
---------------------------------
Do you Yahoo!?
 Better first dates. More second dates. Yahoo! Personals 


More information about the AccessD mailing list