Copy Excel Sheet Content To Email Body In Outlook

How to copy the content of an excel sheet to a mail body in Outlook / HTML file, without changing the format?

With the current list of UiPath activities and product releases, there are no inbuilt functionalities / activities in UiPath Studio for Copying the Excel sheet content to mail body/ HTML file.

A workflow would be required to be designed, by trying to create a custom activity through which the required functionality can be achieved.

The procedure to Create Custom Activity

  1. Write the whole custom code in C# or VB language into one Class Library project
  2. Make a nupkg file for the project
  3. Use this nupkg file as a custom activity, based on the requirement.

The key pointers on designing the workflow -
  1. Read the whole data to a data table using Read Range Activity
  2. Ceate a empty text file in which we are gonna append the Excel rows in HTML format
  3. Use ForEach Row activity and read in loop
  4. Append the rows in to the file created with HTML tags to make it look as a Table
  5. Repeat the same until the HTML code with the sheet present, is created
  6. Pass the same HTML content as the body and ensure IsBodyHtml property is checked in Send Outlook Mail Message activity.