Determine if a Word cell is merged

落花浮王杯 提交于 2019-12-02 00:53:13

When dealing with tables that might contain merged cells, you always have to start with CELL(1,1) and step through the cells using CELL.NEXT (Next is a property of the CELL object)

If you do that, you can interrogate what row and column the "current" cell is. You +can not+ reference cells by row col directly in tables with merged cells or you'll get the error you mention.

Then just continue through till NEXT returns nothing.

You will have to put off merging until you have dealt with all of the records.

Word doesn't work well with tables.

I suggest you create an Excel Workbook, and link the Worksheet from your Excel Workbook to your Word Document. Excel deals best with tables.

Well I ended up describing the layout of the table in the Table Properties / Alt Text / Decription area. And then reading that in the code to split the cells, delete rows and then remerged the cells. Crude but it works.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!