vbCrLf, Environment.NewLine doesn't work on Outlook

Hi all,

I am trying to use RPA to send out email. But whenever it reads the code “vbCrLf” or “Environment.NewLine”, it does not give me a new line. Instead, he went to other parts of the email like scrolling down my inboxes, changing my tabs, going to other section of the email. When I remove all the vbCrLf and Environment.NewLine codes, it runs perfectly.

Is it got to do with my Outlook setting?

Hi @Wing_Ben_Wong
did u use “Environment.NewLine” or Environment.NewLine?

if you had used “Environment.NewLine” then it on’t give u a new line

eg :

input_string = “Hi”+Environment.NewLine+“How are you”

the out put of the string will be

How are you

Hope it helps you
Nived N
Happy Automation

1 Like

Hi, I was using type into function, and my programme goes something like this:

"Hi all, " + Environment.NewLine + _
“Please take a look at the xxx.” + Environment.NewLine + _

The same goes for vbCrLf. Both came out the same issue, that it will jump to other tabs, scroll through my email inboxes, etc.

With the assumption that we are talking about new lines within the mail body text
Incase of isBodyHTML is activated:

  • new lines can be done with <br> tag e.g

Hello Bot, <br> How are you?

Oh. I am not using Send Outlook Message. I am trying out “Attach Window” function and other things

left mouse click on the activity (e.g. send Outlook Mail Message)
and checking on right side the properties

Please give us more details on your flow. e.g screenshot from the implementation parts. Thanks

wondering why not the send mail activity is used.
give a try on
"Hello Bot, [k(enter)] How are you"

There is a red exclamation mark at the side.

Previously I did use the “Send Outlook Message Activity” and it was successful. I thought of trying out this other method. Somehow I came across this error.

Please share as much info with us that we have a chance to check

[k(enter)] is string content and has to be surrounded by " as well.

Oh wow. It works. Thanks man!

Just do your final testing and if it is working close the topic by marking the solving post as solution. Thanks

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