A
A
AleksMo2020-10-09 13:29:48
C++ / C#
AleksMo, 2020-10-09 13:29:48

How to know that all cells in a table are merged (row by row) C# VS?

Good time of the day! Need help!
There is a table:
5f803a97ef598655768053.jpeg

How to know that all cells in a table are merged (by rows)?
using Microsoft.Office.Interop.Word;

Does not work!

if (table.Cell(i, iCols).Range.Cells.Count == 1) 
                         {
                             table.Cell(i, iCols).Range.Bold = 1; // Шрифт жирный
                             MessageBox.Show("Все ячейки объединены в одну!" + i + " " + iCols);
                         }


It used to work, but when the cells appeared, the vertical union stopped working!

if (table.Rows[i].Cells.Count == 1)
                  //-------------------------------------------------
                        {
                            //MessageBox.Show("Горизонталь конец " + i + " " + iCols);
                           // Шрифт жирный                           
                            table.Rows[i].Range.Bold = 1;
                        }


Thank you all in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
cicatrix, 2020-10-09
@AleksMo

See Range.MergeCells property.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question