Document doc = new Document();

DocumentBuilder builder = new DocumentBuilder(doc);

//builder.MoveToBookmark("experiencetranslation");//如果设置了书签可以直接定位到书签处

builder.InsertHtml("

"

" +

"

Row 1, Cell 1" +

"

Row 1, Cell 2" +

"

" +

"

" +

"

Row 2, Cell 2" +

"

Row 2, Cell 2" +

"

" +

"

");

doc.Save(MyDir + "DocumentBuilder.InsertTableFromHtml Out.doc");

// doc.Range.Bookmarks.Clear();//清除书签

// doc.Save(DateTime.Now.ToString("yyyy-MM-dd") + ".doc", SaveFormat.Doc, SaveType.OpenInWord, Response);

更多推荐