PowerPoint 2007 Tables: Defining Merged Cells

How to define merged cells in PowerPoint 2007? In any case, we can find that a particular cell is merged.

In 2003, we tried to access the Fill.Visible property of a cell, and when it throws an error, we can identify the cell as a merged cell. How do we achieve this in 2007?

+4
source share
3 answers

It's hard. However, the best way I've found is to check the width of the cell. This code is not the best, as it catches every cell, but this may be the starting point for you:

 Dim r As Row Dim co As Column Dim c As Cell For Each co In tbl.Columns For Each c In co.Cells If c.Shape.Width <> co.Width Then Debug.Print "Is merged cell" End If Next Next 

In a 2x2 table, where cells 2.1 and 2.2 are merged (that is, the second row is now one cell), it will print โ€œIs a merged cellโ€ twice because cells 2.1 and 2.2 are still stored inside the table. But this is the starting point, as indicated ...

+3
source

I think it would be much better to compare c1.Left == c2.Left && & c1.Top == c2.Top. This means that 2 cells are combined. To go through all the cells only once, I just delete the โ€œduplicatesโ€ using LINQ Distinct and Custom Comparer.

0
source

Cells that are combined together will have the same cell.Shape.Name . Unfortunately, while this works in PowerPoint 2003, you get a NotImplementedException when querying the name of these Shapes on PowerPoint 2007. I do not know about later versions.

0
source

All Articles