Hello Dave,
OK. If we do not want to process it 3 times, we can do the following logics,
1. First, we got the table's Left property by table.Cell(1,1).Shape.Left.
2. In our iteration of the Cells of that table, if the the columnindex is
not 1 and the cell's Left equals to the table's Left, that means the cell is
a merged cell but not the first one.
The following C# codes work fine in my side,
----------------------------
PowerPoint.Application app =
Marshal.GetActiveObject("PowerPoint.Application") as PowerPoint.Application;
PowerPoint.Presentation pres = app.ActivePresentation;
PowerPoint.Table table = pres.Slides[1].Shapes[1].Table ;
int rowsCount = table.Rows.Count;
int columnsCount = table.Columns.Count;
float tableLeft = table.Cell(1,1).Shape.Left ;
for (int i = 1; i <= rowsCount; i++)
{
for (int j = 1; j <= columnsCount; j++)
{
if (j != 1 && table.Cell(i, j).Shape.Left == tableLeft)
{
Console.WriteLine("Cell " + i.ToString() + " " +
j.ToString() + " is merged cell, and not the first one");
}
}
}
----------------------------
Hope this helps! Let me know if you have further questions on this. Have a
nice day!
Best regards,
Ji Zhou - MSFT
Microsoft Online Community Support
David Thielen said:
Hi;
Yes, this is a problem for us because our AddIn walks the objects in
each slide. So when we walk the cells, we get the same cell 3 times in
this case.
This is a major problem because we can have a tag in that merged cell,
and we do not want to process it 3 times.
thanks - dave
david@
[email protected]
Windward Reports --
http://www.WindwardReports.com
me --
http://dave.thielen.com
Cubicle Wars -
http://www.windwardreports.com/film.htm