Fill Excel Data into Word Document

Hi All,

Please help me with this scenario where we have a Word file with a pre-saved email body and we want to fetch values from an Excel sheet and send that email to a customer. Please find the attached sample input for your reference.
Input.zip (21.2 KB)

@reetmehta

Youc an read both and then use str.Replace method to fill the dat from excel

Eg : say in word you have hi how are you

Then read the data of word into str variable then use str.Replace("<Name>",Excelvaluevar)

Cheers

@reetmehta

Try as below

Hope this may help you

to get the word application scope you need to install the UiPath.word.activities package

Thanks,
Srini

@reetmehta

Like above you can keep those as a template
Now if you have multiple rows of data then you have to use For Each row datatable activity and copy the file from the template folder with the customer name or some other name

So the template remains same, but you will have multiple files to send and according to the excel data

Hope this may help you

Thanks,
Srini

Hi @reetmehta ,

Could you let us know in some more details what is it that you want to perform ?

Do you want to update the Word File with Values and send it to the Customer as an Attachment through mail ?

Or Do you want to send the filled Table within the Email Body to the customer ?

Hi

Use the “Excel Application Scope” activity to open the Excel file and read the data from the Excel sheet.

Then Use the retrieved Excel data to format the email body as per your requirement. You can concatenate the values from the Excel sheet with the pre-saved email body using string manipulation activities like “Concatenate”.

Use the “Send Outlook Mail Message” activity to create a new mail in Microsoft Outlook.
If required, you can use the “Word Application Scope” activity to open the Word file containing the pre-saved email body. Once the email is sent, you can save and close the Word file using the “Save Document” and “Close Application” activities respectively.

Thanks!

Hi @supermanPunch,

I want to send the filled table within the Email Body to the customer. But the table in the input file will be different for each customer like for some customer we will send filled table with-

PO Order Customer name Quantity Item Description Comments Action

for some :

PO Order Item Comments

whatever will be mentioned in the templet accordingly we have to send the filled table within the Email Body.

Hi @Srini84 ,

I can not edit my mail template as and the table in my mail template cannot be the same as for some customers I have to share details like-

Order Customer name Quantity Item

for some customers:

Customer name Item Action

Thank you

Hi @Nitya1,

Thank you so much for your reply, Can you please share .xaml file for my reference.

@reetmehta

Then you have to build the HTML Template instead of the Word file

For building the HTML template and send email check below post

Check below for your reference

Hope this may help you

Thanks,
Srini

@Srini84 Can you please help me with how can i read only text from my word file by excluding table.

@reetmehta

Install UiPath.Word.Activities

Use Word Application scope and use Read Text

image

Hope this may help you

Thanks,
Srini

@Srini84 This will also read the table in Word file as a string. I don’t want to read the table from word file.

if your primary requirement to use the file as template , then their is not point of having the table in the document

Instead of table keep a key word , so that while building html content you can replace that or split the paragraphs and use that

even you can use normal text file as well.

Regards