I want to save all the data that has been merged in one document rather than saving it in separate documents. Below is the code of how it currently save each DataRow that has been merged into a separate document.
// Loop though all records in the data source.
foreach (DataRow row in data.Rows)
{
// Execute mail merge.
doc.MailMerge.ExecuteWithRegions(data);
// Save the document.
doc.Save(string.Format(@“c:_Employees\Output\Employee_{0}.docx”, counter++));
}
Currently the save method is within the loop, but how do I add that info the a document and save it as a whole when the loop is finished?