Automate Zip. Zip a folder and email it

Task Description

Zip all document of a folder that are two days old and email it as an attachment.

T21.atmx

Note: Save the .atmx file in My Documents -> Automation Anywhere -> Automation Anywhere -> My Tasks

Solutions

Create new task

  • Click on New -> Task Editor.

Copy all documents that are 2 days old

  • Using the Programs/Files/Windows category select Files/Folders command.
  • In the Source File(s) with path select the path which contains the *.doc files.
  • In the Source File(s) with path select the path which contains the *.doc files.
  • In the Destination folder with path select the path were you want to copy all the *.doc files.

Zip the folder

  • Copy Files "C:\MyFolder\*.doc" to "C:\MyFolder\MyZippedFiles\"
  • Click on "Advance View >>" and select the Date box. From the list, select created date, and specify 2 in the box next to "in the last".
  • From the Program/Files/Windows category select Files/Folders command.
  • In the Files/Folders wizard select the Zip file(s) option.
  • In the Select file(s) to compress type the path of the folder that contains all document Files.
  • In the File Type specify *.doc for zipping word files. And, in the Destination Zip File specify the path along with the zip file name, where the zip file has to be created.
  • Zip file(s) from "C:\MyFolder\" into file "C:\MyFolder\MyZippedFiles\$Day$_$Month$_$Year$.zip"

Send the file as attachment.

  • Select Insert Keystrokes command from the Keystroke/Mouse category. And Insert the keystrokes to create a new mail and send the zip file as an attachment.

T21-1

Screenshot 1

T21-2

Screenshot 2

T21-3

Screenshot 3

When you run this task, it will copy all the document files that are 2 days old from a specified folder to another location and zips all the documents, and then sends the zip file as an attachment.