Here I will show you a simple way to add a file to a zip file using Access VBA and WinZip:

Call ZipFile_FX("c:\a.zip", "c:\a.xls")


Private Sub ZipFile_FX(ZipFileName As String, fileToBeZipped As String)

Const ZIPEXELOCATION = "c:\program files\winzip\winzip32.exe"

Shell ZIPEXELOCATION & " -a " & Chr(34) & ZipFileName & Chr(34) & _
" " & Chr(34) & fileToBeZipped & Chr(34), vbNormalFocus

End Sub

Command line parameters for WinZip

Winzip is one of the most popular programs on the planet and if you want to automate it, they recommend upgrading to Winzip Pro and installing the free command line utility. If you want to try command line parameters without upgrading to Winzip pro, try the commands on this page using Windows Start then the Run text box. Read more here

Author Bio.

Garry Robinson has been involved in over a 100 Access projects, edits his companies web site at http://www.vb123.com/ and is a contributing editor to the Smart Access magazine. When Garry is not sitting at a keyboard, he can be found playing golf or swimming down at his local Sydney beach. Contact details

or you can download this sample by. Albert D. Kallal

2 komentar:

Alex said... 6/28/2009

Inside zip files there are many information and sometimes this info are corrupted,for solve this problem and similar issues advise to use-zip damaged,tool is free as is known,it has so many facilities,program can be also used, when a removable media, where an archive was located, is physically damaged and WinZip archiver cannot extract your files from it,program is a must have for all users, who often work with Zip archives, it will help you and your friends anytime,can work under all versions of Windows operating system, no need to take care about compatibility problems, Windows Vista is also supported,open Zip archives, analyze it for errors and look through the list of files, that can be recovered,repair damage zip file uses several intellectual algorithms to extract your data and compare the results.

Alex said... 3/01/2010

Today my friend called me up and told about an interesting tool - fix zip file contents corrupted,which as he said changed his mind about tools in like sphere. It recovered all corrupted zip files in his PC for seconds and without money. Moreover he was quite right and the tool solved my like old issues easy and fast.

 
Top