Aspose.Words 实现删除行和列

1 删除行

实现代码:

Document doc =new Document("c:/test.doc");
//获取文档中的第一个表.
Table table = (Table)doc.GetChild(NodeType.Table, 0, true);

//删除行第一种方法
row.Remove();
Row row = Row.FromIndex(table, 0);//从表中获取第1行
//删除行第二种方法
table.Rows.RemoveAt(0);

2 删除列

实现代码:

Document doc =new Document("c:/test.doc");
//获取文档中的第一个表.
Table table = (Table)doc.GetChild(NodeType.Table, 0, true);
//从表中获取第1列
Column column = Column.FromIndex(table, 0);
//删除列
column.Remove();

版权声明:本文为qq_38974638原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。