+ Reply to Thread
Results 1 to 7 of 7

Attach File as Zip

  1. #1
    Forum Contributor
    Join Date
    02-20-2007
    MS-Off Ver
    2003 & 2007
    Posts
    299

    Attach File as Zip

    I am using the following code to attach my active workbook as a lotus notes email attachment. Is it possible to edit the code so it will attach it as a zip file.

    Thank you for your time and help.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885
    Hello erock,

    Perhaps this site will give you some pointers: http://www.rondebruin.nl/zip.htm

    This page, also provided by Ron De Bruin, uses Windows XP's built-in Zip utility, not Winzip: http://www.rondebruin.nl/windowsxpzip.htm
    Last edited by Paul; 12-05-2007 at 04:12 PM.

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello erock24,

    Here is macro to zip a file using WinZip.
    Please Login or Register  to view this content.
    Example
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

  4. #4
    Forum Contributor
    Join Date
    02-20-2007
    MS-Off Ver
    2003 & 2007
    Posts
    299
    Here is macro to zip a file using WinZip.
    Thank you very much for the code. However, I have been unsuccessful in combining your code with my code. the path is the active workbook path (ActiveWorkbook.FullName). I need to zip this and use this new file/path as my attachment in my email. Any Ideas on how to commingle our codes to zip and attach the current workbook??

    Thank you for your time and help.

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello erock24,

    Does your call look like this? If your workbook hasn't been saved yet, there won't be an ActiveWorkbook.Path.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

  6. #6
    Forum Contributor
    Join Date
    02-20-2007
    MS-Off Ver
    2003 & 2007
    Posts
    299
    the workbook gets saved. Could you post what the entire code should look like after these codes get combined. I don't know how to combine them and I don't know how to use the "private declare function".... this goes in same module in front of the sub??

  7. #7
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello erock24,

    I am no expert on Lotus Notes. Your code is sending the email first and then saving it. For the zip macro to work, the email document has to have been saved already. I don't know how to do that in Lotus Notes.

    The zip macro needs to placed in a Standard VBA Module. Here is the macro code again. The instructions follow on how to install it.
    Please Login or Register  to view this content.
    Adding the Macro
    1. Copy the macro above pressing the keys CTRL+C
    2. Open your workbook
    3. Press the keys ALT+F11 to open the Visual Basic Editor
    4. Press the keys ALT+I to activate the Insert menu
    5. Press M to insert a Standard Module
    6. Paste the code by pressing the keys CTRL+V
    7. Make any custom changes to the macro if needed at this time
    8. Save the Macro by pressing the keys CTRL+S
    9. Press the keys ALT+Q to exit the Editor, and return to Excel

    Sincerely,
    Leith Ross

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1