How to insert, in Outlook, a text with another color?

Hello,
I need to modify an email in Outlook with add a text with a different color (red by example) ?
It seems difficult to manipulate color in UiPath.
Is anyone can help me please ? Thanks.

1 Like

Hi @corinne_baudens,

Have you tried to use HTML?

How do you intend to send the email? Using an email activity or through Outlook UI?

Hi @gustavo.cervelin,

Thanks for your answer.

I need to modify an email then saved it (with the text added) and then moved it in “Inbox” folder.
In order to insert my text I use the activity “Set to clipboard” followed by "Send HotKey (CTRL end).
I tried to use HTML in the “Set to clipboard” ( <span style=“color:white”…> but the HTML is not recognized and my text with html tags appears in the mail.
It’s not the good result !!!

1 Like

Hi @corinne_baudens,

Thanks for sharing more details.

Ok, I don’t know exactly what you want to modify. But, you could try a different approach…

I suggest the following workaround:

1 - Open some HTML builder online tool. Example: https://html5-editor.net/
2 - Insert HTML code

3 - Select all formatted text and copy it
4 - Paste into Outlook

Hi @gustavo.cervelin,

Thanks for your answer.
I need to open an e-mail, modify it by complete it with a new text line in the bottom of all the text, then moved it in an another folder.

I understand your idea but the text I need to add in my e-mail is stored in the config file (.xlsx).
Here is my text in the “SetToClipboard” activity :
image .

This approach unfortunately doesn’t work.

I’ve just need to change the color text in a copy/paste !! this is the only step in my customer process that is not working !!

1 Like

Hi @corinne_baudens,

Correct me if I got it wrong, but as I understood, that’s what you need:

Note 1: 123456 and “this is a message” came from Config Dictionary. You just need to create a String variable to define your HTML template and use String.format to replace by config values. In this example, I used:
htmlTemplate = "<p><span style='color: #ff0000;'><strong>{0} - {1}</strong></span></p>"
Then, assign to anther variable:
finalMessage = String.Format(htmlTemplate, Config("str_code_catalogue").ToString, Config("str_messageRPA").ToString)

Note 2: Finally, you just have to move to the folder you want. The video doesn’t contain this part. If you need help to implement it, just let me know.

Hi @gustavo.cervelin,

Thanks for your answer.
It’s so great, that’s exactly what I was looking for !!!
You’re the Best !
Thanks !

1 Like

Hi @corinne_baudens

Thank you so much hahaha

Glad it helped you.

Let me know if you want me to share the project with you.

Please, mark my answer above as the solution :slight_smile:

Thanks

What do you mean please by “Let me know if you want me to share the project with you.” ?

1 Like

I mean, the automation that I ran in the video.

It’s a draft, but you can get an idea of the implementation

My global project it’s a confidential project for a customer so I can’t share it.

Have a nice day :grinning:

1 Like

No, no

I mean… I would send the project I built (the automation I ran while recording the video)

Have a good day :slight_smile:

Yes of course. Your video should help other people in the same case as me !
Let’s go ! :+1:

1 Like

Hi @corinne_baudens,

Here you go…

OutlookEmailEdit.zip (76.3 KB)

For those who download the project… just be aware it’s a draft.

So, activities must be renamed, the project must be reorganized, annotations must be included, selectors must be updated, etc.

It is just to give an idea of how to implement it.

1 Like

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