Aspose.Words C# 設置指定單元格背景色


            Document doc = new Document("文檔路徑");
            NodeCollection allTables = doc.GetChildNodes(NodeType.Table, true); //獲取文檔中所有表格
            Aspose.Words.Tables.Table tableTmp = allTables[0] as Aspose.Words.Tables.Table;//獲取第1個表格
            Aspose.Words.Tables.Cell c = tableTmp.Rows[0].Cells[0];//獲取第一行第一個單元格
            c.CellFormat.Shading.BackgroundPatternColor = System.Drawing.Color.Blue;//設置單元格背景色
            tableTmp.Rows[0].Cells[0].Remove();//移除第一行第一個單元格
            tableTmp.Rows[0].Cells.Insert(0, c); //將單元格c 插入第一行第一個單元格的位置

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM