Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Call Shell("C:\Programms\WinZip\wzzip.exe C:\Folder1\Folder2\File.zip C:\FolderA\FolderB\File1.txt C:\FolderC\FolderD\File2.doc", vbMaximizedFocus)
Private Sub cmdZipIt_Click()
Me.MousePointer = vbHourglass
CreateEmptyZip "c:\myDir\testzip.zip"
With CreateObject("Shell.Application")
' Copy a file into the compressed folder.
.NameSpace("c:\myDir\testzip.zip").CopyHere _
"c:\myDir\myMdb.mdb"
'use this line if we want to zip all items in a folder into our zip file
'.NameSpace("c:\myDir\testzip.zip").CopyHere .NameSpace("C:\myDir\Files").Items
End With
Me.MousePointer = vbDefault
End Sub
Public Sub CreateEmptyZip(sPath)
Dim strZIPHeader As String
' header required to convince Windows shell that this is really a zip file
strZIPHeader = Chr$(80) & Chr$(75) & Chr$(5) & Chr$(6) & String(18, 0)
With CreateObject("Scripting.FileSystemObject")
.CreateTextFile(sPath).Write strZIPHeader
End With
End Sub
Private Sub ReadZip_Click()
ShowZipFileContents "C:\myDir", "TestZip.zip"
End Sub
Public Sub ShowZipFileContents(FolderPath As String, Filename As String)
Dim shApp As Shell32.Shell
Dim shFolder As Shell32.Folder
Dim shFolder2 As Shell32.Folder
Dim shFolderItem As Shell32.FolderItem
Dim shFolderItem2 As Shell32.FolderItem
Set shApp = New Shell32.Shell
Set shFolder = shApp.NameSpace(FolderPath)
Set shFolderItem = shFolder.ParseName(Filename)
Set shFolder2 = shFolderItem.GetFolder
For Each shFolderItem2 In shFolder2.Items
Debug.Print shFolderItem2.Name
Next shFolderItem2
End Sub