String not come with original format

Hi ,
please any one help to me,

my problem is in word document some word in bold format and deferent style,
when i get this text in string variable then in not come in original format. it shows plane text.
how to solve this problem?
for exmlple:
๐“๐ก๐ข๐ฌ is ๐ƒ๐จ๐  โ€” original text
This is a Dog โ€“ in message box result

please help me

@Vinayak_Kapse
What method are you using to extract the text

hi @rajneesh94

i have downloaded word package. and used read text file.

When you retrieve text from a Word document into a string variable, the formatting information isnโ€™t directly preserved in the string variable because a plain string variable canโ€™t store formatting information.

You can use copy and paste directly from a formatted Word document to preserve the format.

May i know the use case? What are trying to do?

Hi @AJ_Ask
my use case is i have template in word. which is in paragraph.
adding some condition in want to mail paragraph condition wise.
for example
1=โ€œVinayakโ€ then send this paragraph on mailโ€ฆ
but when i send email, then text is plane not bold and other style

Hi @Vinayak_Kapse

Use a Word file with HTML tags as the input for the email body which will preserve the formatting in UiPath:

Read Word File:

Utilize the โ€œRead Text Fileโ€ or โ€œRead Word Fileโ€ activity to read the content of your Word file into a variable.

Send Email:

Choose an email activity (e.g., โ€œSend Outlook Mail Messageโ€).
Set the variable containing Word file content as the body of the email.
Ensure the email activity supports HTML formatting, and set the IsBodyHtml property to True.

For ref: How to insert HTML code to UIpath SMTP send mail body

Hope this helps:)

@Vinayak_Kapse

Try updating the UiPath.Word.Activites to latest version because for me the output of Read Text activity preserves the formatting

Cheers

Hi @rajneesh94

Thanks for replay, it doesnโ€™t work in my machine. my current version is 1.18.1
can you please share your version of word.

@Vinayak_Kapse

It is the same for me. Since youโ€™re using it as a template, you can also go with storing the content in HTML format and use it to as a mail body. It will surely get your desired formatting.

Cheers