'UnzipTEST "C:\TEMP\ZIPFILE.ZIP","C:\TEMP" THIS WORKS
'UnzipTEST "C:\TEMP\ZIPFILE.ZIP","C:\TEMP", "SUBDIR" THIS WORKS
'UnzipTEST "C:\TEMP\ZIPFILE.ZIP","C:\TEMP", "A.TXT" THIS DOESN'T WORK
'UnzipTEST "C:\TEMP\ZIPFILE.ZIP","C:\TEMP", "SUBDIR\A.TXT" THIS DOESN'T WORK
'UnzipTEST "C:\TEMP\ZIPFILE.ZIP","C:\TEMP", "\SUBDIR\A.TXT" THIS DOESN'T WORK
'UnzipTEST "C:\TEMP\ZIPFILE.ZIP","C:\TEMP", "C:\TEMP\SUBDIR\A.TXT" THIS DOESN'T WORK
Sub UnzipTEST(strZIPfile As String, strOutputFolder As String, Optional strSingleFileName As String)
Dim FSO As Object
Dim oApp As Object
'Extract the files into the newly created folder
Set oApp = CreateObject("Shell.Application")
If strSingleFileName <> "" Then
oApp.Namespace((strOutputFolder)).CopyHere oApp.Namespace((strZIPfile)).Items.item((strSingleFileName))
Else
oApp.Namespace((strOutputFolder)).CopyHere oApp.Namespace((strZIPfile)).Items
End If
End Sub
|