我使用DocX项目创建一个word文档。
我需要把表格插入我的医生,但我不知道该怎么办?
string fileName = @"D:\Users\John\Documents\DocXExample.docx";
// Create a document in memory:
var doc = DocX.Create(fileName);
// Insert a paragrpah:
//doc.InsertParagraph("This is my first paragraph");
// Save to the output directory:
doc.Save();
// Open in Word:
Process.Start("WINWORD.EXE", fileName);发布于 2016-01-24 11:05:15
示例代码:
Table t = document.AddTable(20,2);
t.Rows[0].Cells[0].Paragraphs.First().Append("value1");
t.Rows[1].Cells[0].Paragraphs.First().Append("value2");
t.Rows[2].Cells[0].Paragraphs.First().Append("value3");https://stackoverflow.com/questions/20223844
复制相似问题