Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WinZip automation?? 1

Status
Not open for further replies.

thegameoflife

Programmer
Dec 5, 2001
206
US
Has anyone heard of automating WinZip with VBA? I'm trying to develop a personal "backup" of sorts.
 
I haven't seen anything about automating Winzip through OLE but in the old days everybody would just use BATCH files and straight BASIC to run PKZIP and PKUNZIP. You have to be familiar with the command-line syntax but it's pretty straight-forward.

I don't know if I can still do it without checking the help files:


Code:
C:> pkzip -d -r C:\MyFile.dat A:\MyZip1.zip

Ha Ha, don't trust that - it's a shot in the dark [bugeyed]

Good Luck,
VBSlammer
redinvader3walking.gif
 
I think I got this code from Tek-tips a while back. I am creating a speadsheet, zipping it and emailing it. Here is the code to zip it. Hope this helps.
Function ZIPIT()
Dim strAppName As String
Dim strDbFile As String, strZipFile As String

'WinZip 8.0 by WinZip Computing, Inc. is used here...

strAppName = "C:\Program Files\WinZip\WINZIP32.EXE"

'Add soft or hard coded paths to file variables if needed...

strZipFile = "I:\HIJLocs.zip"
strDbFile = "I:\LOCS.xls"
strDbFile = "I:\ControlLOCS.xls"

Call shell(strAppName & " -a " & strZipFile & " " & _
strDbFile, 1)

MsgBox "Your database " & strDbFile & " was zipped as " & _
strZipFile & " and is ready for emailing!"
End Function


Sean
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top