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.
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)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.