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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Zip and Email

Status
Not open for further replies.

Gnism

Technical User
Jan 9, 2003
29
0
0
US
Hello,
Let's try this again...I’d like to be able to press a button that would zip the current database and attach it to an email.

I'm at the point where I can copy my current database and attach it to the email, but it’s the zipping that I can’t figure out. Would I need to use some form of WinZip’s command prompt (how???) or is there code one could use for “WinXP’s compress file” ability if WinZip is not installed?

Gnism.
 
Zipping open database is not a good idea. When any changes are made during zip process corrupt files are the result. Especially if you are trying to zip this from a macro or VBA code. Best recommendation is to install winzip, close database, locate using windows explorer, right click on .mdb file, select zip and email option.
 
Thanks for your response Jeff,

The desired zipping would occur on the backup database and/where no changes would be taking place. I would like to do exactly what you describe but with code. You know how some users are - they prefer doing things with the touch of a button.
 
This will zip your mdb file. First download the winzip command prompt file at
This assumes that winzip is installed on drive C: under program files\winzip and that the mdb file that you want zipped is in C:\databases by itself. It will create a zip file named myfile.zip

you can modify any of these paramaters to fit your needs.

next place a new command button on a form and under the on click event paste this code or add it into the existing code you have already.

Call Shell("C:\Program Files\WinZip\wzzip.exe C:\databases\myfile.zip C:\databases\*.mdb", 1)

You reminded me how much I hate when I post a question on something I want to do and all I get is responses that I shouldn't do that. Thanks.

If you need more help I'll try but I am weak with mail protocols and the like.
 
Thanks again Jeff, this will work out just fine. I'll have to do a couple of things by moving my file from the network to the local machine but that command line is pretty slick...

Nev.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top