Windows XP has a built-in ZIP mechanism integrated into its file-system. We can easily use this to extract standard ZIP files with only a few commands:
1: 'Variable Definition
2: Dim sZIPFile
3: Dim sExtractToPath
4:
5: Dim oShell
6: Dim oZippedFiles
7:
8: 'Variable Initialization
9: sZIPFile="C:\Source.zip"
10: sExtractToPath="C:\Dest\InnerDir\"
11: Set oShell = CreateObject("Shell.Application")
12:
13: 'Get the contents of the ZIP archive
14: Set oZippedFiles=oShell.NameSpace(sZIPFile).items
15:
16: 'Copy the contents into the destination folder
17: oShell.NameSpace(sExtractToPath).CopyHere(oZippedFiles)
18:
19: 'Free Objects
20: Set oZippedFiles = Nothing
21: Set oShell = Nothing
22:
Posted in ZIP

Yaron Assa




May 21st, 2008 at 10:10 am
thank you very much
May 22nd, 2008 at 1:31 pm
Thanks a lot ..
I was searching for this only…but not getting proper solution…
Now it works properly.
May 17th, 2010 at 9:50 am
Hi Yaron,
I am getting error: “Object required: ‘oShell.NameSpace(…)’”.
June 4th, 2010 at 9:53 pm
thank you very much