C# Aspose.Word表格修改以及格式设置

        #region 对表格进行修改
        private static Table EditCell(Table table, Document doc, int row, int cell, string value)
        {
            Aspose.Words.Tables.Cell c = table.Rows[row].Cells[cell];
            Paragraph p = new Paragraph(doc);
            p.AppendChild(new Run(doc, value));
            p.ParagraphFormat.Style.Font.Size = 8;    //设置字体大小
            p.ParagraphFormat.Style.Font.Name = "宋体";           //设置字体格式
            c.FirstParagraph.Remove();
            c.AppendChild(p);
            table.Rows[row].Cells[cell].Remove();
            table.Rows[row].Cells.Insert(cell, c);
            return table;
        }

        #endregion

猜你喜欢

转载自blog.csdn.net/qq_20799821/article/details/109537022