Take parts of Outlook message

Hello everyone!

I have message:
qwerty,
asdf,
zxcv,
cvbnm

I need take “qwerty”, “asdf”, “zxcv”, “cvbnm” and write it one by one in different variables.
I did Assign:
first = mail.Body.Split(“,”.ToCharArray)(0)

How to tale all of them in different variables and save?

@RPA3

Split it based on comma as delimiter as you mentioned in above post.

     arrMail [] = mail.Body.Split(",".ToCharArray)

Then use ForEach loop to iterate one by one item from that array and pass it to different variables.

What do if body of message:
qwerty,
asdf,
zxcv,
cvbnm

From…

From don’t need, but last element now:
cvbnm

From…

@RPA3

Then you have to split it based on New Line.

     arrMail [] = mail.Body.Split(Environment.NewLine.ToCharArray)

@RPA3

Following this , You can use body.contains()
For Each / Followed by if condition to overcome this.

Regards,
Srenivasan Kanna

Where?

How save all element?
Assign don’t work

What about you? I don’t understand.

Could you help me, please?

@RPA3

What you want to do after assigning each value to variable ?

If suppose 100 values are then do you want to create 100 variables ?