Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 29th, 2003, 11:19 AM
Registered User
Join Date: Dec 2003
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Zip File

How can I zip an Access file through VBA?
Reply With Quote
  #2 (permalink)  
Old December 29th, 2003, 11:45 AM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts

Hi there,

I am not sure if you can do that directly with VBA. There may be some third party COM components that can do zipping.

What you could do is use the WinZip command line add on. This add on supports zipping and unzipping from the command line. Together with a WScript.Shell object, you can zip from within VBA code. Here's a small example:
Dim objShell
Set objShell = CreateObject("wscript.shell")
' Zip file with command-line WInZip
Dim ReturnValue
ReturnValue = objShell.Run("C:\winnt\system32\cmd.exe /C c:\wzzip.exe -a MyFileName.zip MyFileToZip.doc", 1, True)
If you have a registered version of WinZip, you can download the add on here: http://www.winzip.com/wzcline.htm



Imar Spaanjaars
Everyone is unique, except for me.
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
zip file Venkatesan .NET Framework 1.x 1 July 4th, 2007 02:25 AM
how can i zip file?? rocksbhavesh VB How-To 1 April 6th, 2007 12:55 PM
Zip File Venkatesan General .NET 0 February 3rd, 2007 05:59 AM
Create zip file sepidehsalek Biztalk 0 February 12th, 2005 06:27 AM
Error in zip file dat2199 BOOK: Professional C#, 2nd and 3rd Editions 0 December 4th, 2003 04:46 AM

All times are GMT -4. The time now is 10:53 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.