如何在c#中访问word文档表的每个单元格 [英] how to access each cell of a table of word document in c#

查看:67
本文介绍了如何在c#中访问word文档表的每个单元格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我的查询是我正在使用这段代码来获取word文档表的每个单元格



hello,
my query is that i'm using this code to get each cell of a table of a word document

foreach (word.Table tables in doc.Tables)
            {
                int r = tables.Rows.Count;
                for (int i = 1; i <= r; i++)

                {

                    foreach (word.Cell cell in tables.Rows[i].Cells)

                    {

                        //any code

                    }

                }                

            }





如果表格中有任何单元格显示错误合并...

i希望用其他文本替换每个单元格的文本...

plz帮我解决这个问题



bt it's showing error if any cell in table is merged...
i want to replace text of each cell with some other text...
plz help me with this

推荐答案

这篇关于如何在c#中访问word文档表的每个单元格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆