解決用Aspose.Words,在word文檔中創(chuàng)建表格的實(shí)現(xiàn)方法
更新時(shí)間:2013年05月20日 09:38:57 作者:
本篇文章是對(duì)利用Aspose.Words,在word文檔中創(chuàng)建表格的實(shí)現(xiàn)方法進(jìn)行了詳細(xì)的分析介紹,需要的朋友參考下
代碼如下所示:
//Open document and create Documentbuilder
Aspose.Words.Document doc = new Aspose.Words.Document("demo.doc");
DocumentBuilder builder = new DocumentBuilder(doc);
//Set table formating
//Set borders
builder.CellFormat.Borders.LineStyle = LineStyle.Single;
builder.CellFormat.Borders.Color = Color.Red;
//Set left indent
builder.RowFormat.LeftIndent = 100;
// etc...
//Move documentBuilder cursor to the bookmark
builder.MoveToBookmark("myBookmark");
//Insert some table
for (int i = 0; i < 5; i++)
{
for (int j = 0; j < 5; j++)
{
builder.InsertCell();
builder.Write("this is cell");
}
builder.EndRow();
}
builder.EndTable();
//Save output document
doc.Save("demo2.doc");
復(fù)制代碼 代碼如下:
//Open document and create Documentbuilder
Aspose.Words.Document doc = new Aspose.Words.Document("demo.doc");
DocumentBuilder builder = new DocumentBuilder(doc);
//Set table formating
//Set borders
builder.CellFormat.Borders.LineStyle = LineStyle.Single;
builder.CellFormat.Borders.Color = Color.Red;
//Set left indent
builder.RowFormat.LeftIndent = 100;
// etc...
//Move documentBuilder cursor to the bookmark
builder.MoveToBookmark("myBookmark");
//Insert some table
for (int i = 0; i < 5; i++)
{
for (int j = 0; j < 5; j++)
{
builder.InsertCell();
builder.Write("this is cell");
}
builder.EndRow();
}
builder.EndTable();
//Save output document
doc.Save("demo2.doc");
您可能感興趣的文章:
- asp.net下用Aspose.Words for .NET動(dòng)態(tài)生成word文檔中的數(shù)據(jù)表格的方法
- asp.net下用Aspose.Words for .NET動(dòng)態(tài)生成word文檔中的圖片或水印的方法
- .net使用Aspose.Words進(jìn)行Word替換操作的實(shí)現(xiàn)代碼
- 利用Aspose.Word控件實(shí)現(xiàn)Word文檔的操作
- C# 利用Aspose.Words.dll將 Word 轉(zhuǎn)成PDF
- 使用Aspose.Cells組件生成Excel文件實(shí)例
- 使用aspose.word 第三方的插件實(shí)現(xiàn)導(dǎo)出word
- C#使用Aspose.Cells控件讀取Excel
相關(guān)文章
C# WinForm制作一個(gè)批量轉(zhuǎn)化文件格式的小工具
在生活中有時(shí)候會(huì)遇到批量轉(zhuǎn)換格式的需求,一個(gè)個(gè)點(diǎn)太麻煩了,一個(gè)能夠?qū)崿F(xiàn)批量文件格式轉(zhuǎn)換的工具非常有用,所以本文小編使用C# WinForm制作一個(gè)批量轉(zhuǎn)化文件格式的小工具,文中有具體實(shí)現(xiàn)代碼,需要的朋友可以參考下2023-11-11
C#中委托的基礎(chǔ)入門(mén)與實(shí)現(xiàn)方法
這篇文章主要給大家介紹了關(guān)于C#中委托的基礎(chǔ)入門(mén)與實(shí)現(xiàn)方法的相關(guān)資料,究竟什么是委托,用最通俗易懂的話(huà)來(lái)講,你就可以把委托看成是用來(lái)執(zhí)行方法(函數(shù))的一個(gè)東西,需要的朋友可以參考下2021-08-08
C#實(shí)現(xiàn)軟件監(jiān)控外部程序運(yùn)行狀態(tài)的方法
這篇文章主要介紹了C#實(shí)現(xiàn)軟件監(jiān)控外部程序運(yùn)行狀態(tài)的方法,可實(shí)現(xiàn)監(jiān)控另一個(gè)程序的運(yùn)行狀態(tài)及觸發(fā)相應(yīng)事件的功能,是非常實(shí)用的技巧,需要的朋友可以參考下2014-12-12
C# webservice接口編寫(xiě)、發(fā)布與測(cè)試
這篇文章主要介紹了C# webservice接口編寫(xiě)、發(fā)布與測(cè)試,文章通過(guò)圖文結(jié)合的方式給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或共組有一定的幫助,需要的朋友可以參考下2024-07-07
c#調(diào)整圖片分辨率的實(shí)現(xiàn)示例
本文主要介紹了c#調(diào)整圖片分辨率的實(shí)現(xiàn)示例,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧2023-10-10
C#中靜態(tài)構(gòu)造函數(shù)的幾點(diǎn)說(shuō)明介紹
本篇文章主要是對(duì)C#中靜態(tài)構(gòu)造函數(shù)的幾點(diǎn)說(shuō)明進(jìn)行了介紹,需要的朋友可以過(guò)來(lái)參考下,希望對(duì)大家有所幫助2014-01-01
C#實(shí)現(xiàn)文本轉(zhuǎn)語(yǔ)音功能
這篇文章主要為大家詳細(xì)介紹了C#實(shí)現(xiàn)文本轉(zhuǎn)語(yǔ)音功能,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2022-03-03

