UiPath Studio X Pass Data from excel to Word

Hello, i am try to pass data from each row of excel to word, however when the word file is getting updated the information on the word files move downwards, which will create issues in the further process. I m using replace text in document in studio X.

I require assistance in keeping the information on the word file at the same place.

Hi @mihir.s.bandodkar

  1. Use the “Excel Read Range” activity to read the data from the Excel file into a DataTable.
  2. Add a For Each Row activity to loop through each row of the DataTable.
  3. Use the “Word Application Scope” activity to open the Word document you want to populate.
  4. Inside the Word Application Scope, use the “Replace Text in Document” activity to replace the placeholders in the Word document with data from the current Excel row.
  • In the “Search Text” field, provide the placeholder from the Word document (e.g., <<Placeholder1>>).
  • In the “Replace With” field, provide the data from the current Excel row corresponding to that placeholder (e.g., row("Column1").ToString).
  1. After replacing the text, save and close the Word document.
  2. The For Each Row activity will automatically move to the next row in the Excel file, and the process will repeat.

Thanks for the response, i m using the above activities which you have mentioned and word file are created for each row in excel however when the data is replaced in the form the data is moving downwards in the word doc which is the issue.

If you’re replacing a placeholder string with a longer string, of course everything has to move. Can you show us the Word file, what you’re expecting (fill it in manually) vs what you’re getting from the automation?

Hello, the placeholder string and the string replacing it has same length.