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

Zipping in a macro

Status
Not open for further replies.

jezmondo

IS-IT--Management
Aug 24, 2001
23
GB
I have created a macro that automatically runs, prints and saves a report .pdf. The .pdf files then need to be mailed however they're obviously too large. Is there a way of zipping the .pdf's via the macro?
 
If you use PKZIP and PKUNZIP, you can use command line to automate the tasks that you want to do. I've done this before using VBA so I know that it is possible.

Hope this helps!!

Brad
 
Use the Shell command to do what Brad suggests (e.g. shell "pkzip report.pdf report.zip").

Justin
 
You can create a COM Object to make the Zip file (with Shell function as jbecher said), then you can use COM Objects to create the mail and Attach the newer zip file, for example, if yoy have a Outlook client, or IIS System, you can use CDont Objects. This is a Framework to manage the mail operations with Mail System.

More Information, msdn.microsoft.com.

Other, you can create a Java Class using Java Mail API (Independent) and Activation Framework (to attaching). You invoke this class with a bacth file, cmd or vbs file. J2EE or previous JDK 1.x.x include a java package to zip or unziping files (java.util.zip), this means that you don't need any external tool (like pkzip)

More Information, java.sun.com or
Good Luck

Juan Ma
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top