Using WinZip I can zip one file with the following code, but I'm having problems getting more then one file into this winzip file.
Any help would be appreciated.
Code:
Private Sub Form_Load()
Dim ZipPath As String
Dim ZipFile As String
Dim ZipApp As Shell
Dim strpath As String
Dim today As String
Dim fol as String
today = Format(Now(), "DD-MMM-YYYY")
Set ZipApp = New Shell
fol = "Z:\Production Database Backups"
strpath = "Z:\Production Database Backups\*.mdb"
ZipPath = fol & "\" & today & ".zip"
CreateEmptyZip ZipPath
With ZipApp
.Namespace(ZipPath).CopyHere (strpath)
End With
End Sub
Public Sub CreateEmptyZip(sPath)
Dim strZipHeader As String
strZipHeader = Chr$(80) & Chr$(75) & Chr$(5) & Chr$(6) & String(18, 0)
With CreateObject("Scripting.FileSystemObject")
.CreateTextFile(sPath).Write strZipHeader
End With
End Sub
Any help would be appreciated.