Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
//builder.MoveToBookmark("experiencetranslation");//如果设置了书签可以直接定位到书签处
builder.InsertHtml("<table>" +
"<tr>" +
"<td>Row 1, Cell 1</td>" +
"<td>Row 1, Cell 2</td>" +
"</tr>" +
"<tr>" +
"<td>Row 2, Cell 2</td>" +
"<td>Row 2, Cell 2</td>" +
"</tr>" +
"</table>");
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);
Aspose.Words for .NET HTML代码直接生成WORD
最新推荐文章于 2024-09-20 20:20:07 发布