Extract Table from Outlook

Hello Everyone, I’m a beginner and I’m trying to capture tabular data from an Outlook mail. The body of the mail looks like as shown below:

I have tried saving the body of the mail in excel file, but the format is getting lost every time when the body of the mail is dumped in the excel file.
Any suggestions or right approach on how I can extract the tables/individual column values from the body? Solution with examples will be much appreciated?

Thank you.

1 Like

Hi,

Check the below link.

I hope it helps!

2 Likes

Thanks, Vinutha! I have already been through the above link. I’m able to extract the body of the mail along with other details from the solution provided there.
https://forum.uipath.com/t/how-to-write-email-body-table-to-excel-file/2141/15?u=rishivc1

The above technique gives sender’s name, subject and mail body in tabular form. But that’s not what I’m trying to achieve. I want to retain the formatting done in the mail body, to be more precise I want to retain the tables sent in the mail as it is so that I can extract the values in different columns for later use.

Here is te excel from the above operation:
test.xlsx (9.1 KB)

The value in my table where choices are entered can have strings of different length, as a result, the other suggestions where they have mentioned to used string formatting to get the required columns turns out to be redundant.

Is there is any other approach to solve this problem? will Screen scrapping help if the format of the body always remains same(i.e the no of rows and columns remain the same )? Can I access various columns of the table and save them into excel or different variables?

Thank you!

There was another solution in the same link… i am posting the link for it below. Did u try that? Just copying the whole thing and pasting it to an excel? I tried this once when i wanted to extract a table from a word and put it into excel in the same way without any changes. I did a recording where i sent hot keys to copy(ctrl + c) the whole doc and opened an excel and pasted it (ctrl + v) and saved it.

1 Like

Hey, thanks :slight_smile: I will update as soon as I will implement it.Trying :slight_smile:

Hello Vinutha, I’m stuck here. Every time when I run my Bot, I end up getting this error:

This is how my Start Process property window looks:

Any Suggestion?
Thank you.

@RishiVC1 Reply to your message:
Start process activity with path of .eml file. Also set outlook as default application to open eml file.

Use build data table to create an empty table with headers.
Use write range without excel application scope and write the table in .xslx excel file.

Now use excel application scope and add the previously saved excel file path … copy the content of outlook email… and save it on excel… press hotkey ctrl + s … it will save it … and do nothing…

Could you please tell me by looking at the screenshot attached, where I’m going wrong ? FolderLocation is the variable that contains the location of directory where .eml file is stored .

Just give the eml file path in start process activity instead of outlook path… No need to give argument and outlook path

1 Like

Hi. I’d tried this approach. My Outlook 2016 launched but it didnt open the .EML file and there is no error message also.
Image 14

I tried this method also but challenge is defining the Selector. I use the Selector to be the file explorer window. But when i run the workflow i got the following error.

Set the default application for opening eml as Microsoft Outlook in its properties.

Open it using start process activity in UiPath. Input is the path of eml file.

Avoid using idx in the parent selector.

2 Likes

Thanks for your help! It’s all good now. My outlook launches and opens up the EML file. The culprit is using the wrong activity. Right activity to use is “Start Process”

Hey Man,

I am getting the same error.

The command line argument is not valid. verify the switch you are using.

Any idea what did you do to rectify this?