I want read a mail body only for the first mail from inside a number(Bulk) of reply mails

need to read data only from the highlighted

@supermanPunch can you help me with this?


Could you let us know what are the steps that you are able to do till now ? Are you able to read the email using the Mail Activities ?

If not you could try using the Get Outlook Mail Messages Activity.

Hi @supermanPunch Thanks for your reply
I am using the Use outlook 365 present
After that I am looping each mail and reading the Body (Currentmail.body)

I want to read a specific body from a bulk of reply mails


Inside for each you can try this,
Step1: Use this Condition for If


Step2: inside If you can assign a variable and read body the specified mail

Body = Currentmail.body


Hi, Henry

Body Content is String that holds all replies. You can get the first one using regex or you could get using references properties in the Header.

Method 1 - Regex: (Assign it to String variable)
(System.Text.RegularExpressions.Regex.Split(Emails(0).Body, “From:[\sA-Za-z0-9<.@:]+>”)).Last

Method 2 - References :
Try this: Emails(0).Headers(“References”).Split(CChar(vblf))

This expression give to you an array of Message ID. The last one is the Original Mail. With this Message ID you can use Get Mail Activity again and provide the Original Message ID, but only works if the Orginal Message is present in the folder that you retreiving your mails

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