Notes 6.5 -- Compress attachments within selected emails

Posted on 2009-02-18
Last Modified: 2013-12-18
In Lotus Notes 6.5, how do I compress or zip the files within all the emails I select/check?

Basically, I don't want to open each email, compress the spreadsheet, and re-attach it.

I'm pretty sure this can be done in bulk somehow, via one of the menu options.
Question by:jamalogist
    LVL 5

    Expert Comment


    You can do this with various 3rd party Products.  One of them that I have found to be very good is ZIPMail by MKNetworks.

    They have a product that you can install on your server and it goes through all DBs and detaches, ZIPs and Attaches all attachments in your DBs.

    Link => and

    There is a fee involved.  Dunno if you get free tools.


    LVL 22

    Assisted Solution

    Below is the Agent that makes use of Java ScriptLibrary that makes possible to zip a file.
    Sub Initialize
    	Dim js As JAVASESSION
    	Dim zipClass As JAVACLASS
    	Dim zipFileObject As JavaObject
    	Dim varFileToZip As String, varOutFilePath As String, returnCode As String
    	Set js = New JAVASESSION
    	Set zipClass = js.GetClass("ZipFile")
    	Set zipFileObject = zipClass.CreateObject
    	varFileToZip = "c:tempdocument.doc"
    	varOutFilePath = ""
    	returnCode = zipFileObject.zipMyFile(varFileToZip, varOutFilePath)
    	If Not returnCode = "OK" Then
    		Print "An Error occurred"
    		Print "Zip went OK"
    	End If
    End Sub
    Uselsx "*javacon" 'Which lets you use Java from LotusScript
    Use "ZipFile"
    'Java lib:
    public class ZipFile {
    	public String zipMyFile(String fileToZip, String zipFilePath) {
    		String result = "";
    		byte[] buffer = new byte[18024];
    		// Specify zip file name
    		String zipFileName = zipFilePath;
    		try {
    			ZipOutputStream out = new ZipOutputStream(new FileOutputStream(zipFileName));
    			// Set the compression ratio
    			// Associate a file input stream for the current file
    			FileInputStream in = new FileInputStream(fileToZip);
    			// Add ZIP entry to output stream.
    			out.putNextEntry(new ZipEntry(fileToZip));
    			// Transfer bytes from the current file to the ZIP file
    			//out.write(buffer, 0,;
    			int len;
    			while ((len = > 0){
    				out.write(buffer, 0, len);
    			// Close the current entry
    			// Close the current file input stream
    			// Close the ZipOutPutStream
    		} catch (IllegalArgumentException iae) {
    		} catch (FileNotFoundException fnfe) {
    			return "ERROR_FILENOTFOUND";
    		} catch (IOException ioe){
    			return "ERROR_IOEXCEPTION";
    		return "OK";

    Open in new window

    LVL 5

    Expert Comment

    Well if jamalogist is not going to use this then I am going to give it a try : )  

    Thanks mbonaci !
    LVL 1

    Author Comment

    Thanks for the very quick responses.  I swear I've seen someone do it from what I thought was vanilla Notes 6.5, but I guess that's not possible.

    So, I'll try these options out.  Maybe I'll install the 30-day ZipMail.  I'm not seeint pricing info on the site, but I suspect after that it's not free.
    LVL 1

    Author Comment

    1) Go to the Inbox.  Clicking to the very left of an email places a check-mark.
    2) Using these checkmarks, select all the emails you would like to process.
    3) In the menu, choose [Actions] => [Attachment Options] => [Zip] or [Remove]

    [Zip] will turn all attached spreadsheets into zip files, [Detach] fully deletes them.
    The end result of either action is a smaller sized inbox / database.

    No coding, no purchasing.
    LVL 1

    Author Comment

    But -- does anyone know why this only seems to work in the Inbox -- not in any of the Folders?

    I have to move an email back into my Inbox, do the Actions => Attachment Options, & move it back..
    LVL 5

    Accepted Solution

    To be honest I do not see that option in my Lotus Notes as you described.

    Then again I'm using R8.5 and the databases are already enabled with LZ1 Compression as set in the Database properties.

    I also cannot recall Notes ever having an option for ZIPPING an attachment as you have described.  Are you 100% certain that you guys do not already have a 3rd party tool that might be doing this?

    It might be that your database is not set to compress attachments and the option to compress is available to you because of this and because your attachments are not compressed.  

    Personally I do not think that LZ1 compression is the most effective way to ZIP/Compress your attachments.  Although you get some compression, you will get better results using a 3rd party tool.

    LVL 46

    Assisted Solution

    by:Sjef Bosman
    Upgrade to R8.0.1,289142,sid4_gci1318822,00.html

    By the way, there are MANY tools available that do this. Don't waste a lot of time on this issue. Time equals money, doesn't it?
    LVL 1

    Author Closing Comment

    I suppose I can't rule out the possibility of a 3rd party plugin already installed allowing me to do this, though it looks native and well-integrated.  Thanks for everyone's ideas again.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

      In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
    Article by: Rob
    Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now