|
c#操作word表格(9) wordApp.Application.Selection.Cut();
//重新成声所有表
for(int i = 0; i<=DT.Rows.Count-1;i++) { wordApp.Application.Selection.Paste(); int k = i+1; #region 更新数据
#region 插入数据行 wordDoc.Tables.Item(k).Cell(1, 2).Range.Text = DT.Rows[i]["1"].ToString();
////****************** wordDoc.Tables.Item(k).Cell(1, 4).Range.Text = DT.Rows[i]["2"].ToString();
////****************** wordDoc.Tables.Item(k).Cell(2, 2).Range.Text = DT.Rows[i]["3"].ToString();
////****************** wordDoc.Tables.Item(k).Cell(2, 4).Range.Text = DT.Rows[i]["4"].ToString();
#endregion
#region 第三行显示 ////****************** wordDoc.Tables.Item(k).Cell(3, 2).Range.Text = DT.Rows[i]["5"].ToString(); ////****************** wordDoc.Tables.Item(k).Cell(3, 4).Range.Text = DT.Rows[i]["6"].ToString();
#endregion
#region 第五行显示 ////****************** wordDoc.Tables.Item(k).Cell(5, 2).Range.Text = DT.Rows[i]["7"].ToString();
|