Copy email body to Excel file, multiple lines

Hi happy helpers

I have come across an issue with reading the email body from an Outlook message and then pasting the value into Excel.
I use the get outlook message activity and read the email.body. No problem.
The email body contains plain text, maybe 500 lines, sometimes up to 30.000 lines.
The problem starts when I use the write cell to write the text in Excel. It pastes the entire text in one cell instead of 500 lines as the example above.
How can I get it to write the email.body to 500 lines in Excel?

Thank you

Bjarne

Hey,
You can try like this save the mail message as .eml format and then open the file and use data scraping to get it as datatable.

Let us know if this helps,
Regards,
Pavan H

Hi @Bjarne_Dreier,

The text you want to write in to excel have any format which will be constant? Can you provide the sample text

Thanks,

Hi

Yes, always like this:

Transaktionsrapport (90222167 Danske Lotteri Spil A/S): Autoriserede transaktioner

Rapporten blev genereret: 08/04-2019 04:13:43

Transaktionsperiode:
Startdato: 07/04-2019 00:00:00
Slutdato: 07/04-2019 23:59:59

Ordrenr.,Transaktionsnr.,Beløb,Gebyr,Korttype,Tidspunkt for autorisation,Gennemførselstidspunkt
7111994200,2421631000,150.00,0.00,V-DK,07/04-2019 00:00:09,07/04-2019 00:00:09
7112010200,2421631000,300.00,0.00,V-DK,07/04-2019 00:01:02,07/04-2019 00:01:03
7112017900,2421632000,300.00,0.00,V-DK,07/04-2019 00:02:18,07/04-2019 00:02:19
7112022200,2421632000,200.00,0.00,MC(DK),07/04-2019 00:03:02,07/04-2019 00:03:03
7112023500,2421632000,180.00,0.00,MC(DK),07/04-2019 00:03:16,07/04-2019 00:03:16
7112027000,2421632000,300.00,0.00,V-DK,07/04-2019 00:03:52,07/04-2019 00:03:53
7112027400,2421632000,50.00,0.00,MC(DK),07/04-2019 00:03:56,07/04-2019 00:03:57
… many more lines

Line number 1 and 9 are always the same (static text)
The lines I need are from line 9 and down, and they always have this comma separated format, but it is ok to extract the full text as we have a macro which deletes line 1-8.

Hi @Bjarne_Dreier,

Please find the attached Xmal file
Forum1.zip (15.6 KB)

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.