As per the code you shared, you are loading a word document from a file, and replace the values in the document with values in the controls. cool. Now I assume you have a datagridview, that needs to be written to the word file, correct? If yes let me give you some pointers.
- You can use the Rows property of datagridview to loop through each row in the gridview. e.g. below foreach (DataGridViewRow row in datagridviews.Rows)
{
// You will get each cell data by using the code
var cell1= row.Cells["cell name 1"].Value
} - Since you are using Spire.Doc, you can refer the tutorials in spire to write the data to table in word document. Refer the following example
https://www.e-iceblue.com/Tutorials/Spire.Doc/Spire.Doc-Program-Guide/NET-Create-Table-Create-Word-Table-in-C-and-VB.NET.html
So in the loop in step 1, use the word table creation.
Hope this helps