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