我正在使用Microsoft.Office.Interop.Word
使用C#创建word文档,但我遇到了问题,
我想创建表,并在特定列中我想创建一些子表每个表在其他子表下。
我写了这段代码,但这不是我需要的:
ProcessTable.Rows[4].Cells[1].Range.Text = "Evidences:";
ProcessTable.Rows[4].Cells[1].Range.InsertParagraphAfter();
ProcessTable.Rows[4].Cells[2].Merge(ProcessTable.Cell(4, 6));
//Create a 1X1 table and insert some dummy record
Table SubTable = document.Tables.Add(ProcessTable.Rows[4].Cells[2].Range, 1, 1);
// to enable borders..
SubTable.Borders.Enable = 1;
ProcessTable.Rows[4].Cells[2].Range.Text = SubTable.Rows[1].Cells[1].Range.Text = "some data";
//Create a 1X1 table and insert some dummy record
Table SubTable2 = document.Tables.Add(SubTable.Rows[1].Cells[1].Range, 1, 1);
ProcessTable.Rows[4].Cells[2].Range.Paragraphs.Add();
// to enable borders..
SubTable2.Borders.Enable = 1;
ProcessTable.Rows[4].Cells[2].Range.Text += SubTable2.Rows[1].Cells[1].Range.Text = "some data";
ProcessTable.Rows[4].Cells[2].Range.Paragraphs.Add();
// 4-Conclusion
ProcessTable.Rows[5].Cells[1].Range.Text = "Conclusion:";
ProcessTable.Rows[5].Cells[2].Merge(ProcessTable.Cell(5, 6));
ProcessTable.Rows[5].Cells[2].Range.Text = @"DATA ";