Aspose.Words for .NET HTML代码直接产成WORD
Aspose.Words for .NET HTML代码直接生成WORD
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);
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);

浙公网安备 33010602011771号