Word template form used to save a new document for each unique person

I read in information from excel and input into a word template form. My problem is I cannot get the loop to create a new form for the next record in excel in the loop. I am trying to close out the word document at the end of the loop and have it reopen so the template replace text works but it is not working.

Open to anyway to find a solution to making a copy of the template for each respective record of data named after the given person.

@Caitlin_Shaughnessy

Inside the for each row in datatable…first use a copy file activity and make a copy of template…and then use that new file to make you changes…you can name the file with person name …so that for each iteration it is a different file

cheers

Thanks for the idea. I have never used the copy activity what is supposed to go in the to and from boxes and how do I name it after the person?

@Caitlin_Shaughnessy

in from just give the template file location

in to or the new name field currentrow("ColumnName").ToString here columnname would be the name column in datatable/excel

cheers

I got that to work thanks! I had another problem arise with the new copy file though. My replace text in the for each row loop is not replacing the text for each individual copy its still reading from the template file.

@Caitlin_Shaughnessy

In the word file activity i beleive you passed template instead pass the copied file

Cheers

Do I need to make a new application scope after the original template scope? But how do I do this when the file copy is constantly changing?

@Caitlin_Shaughnessy

Template is not needed now…directly change on copied one …so just change the path

Basically whatever you gave in to field of copy file give the same here

Cheers

@Caitlin_Shaughnessy

use the word application scope inside the loop…remove it from outside the loop

cheers