1

Topic: How program to change a figure background in a table cell?

There is a table where in some cells there is a figure (rectangle), it is necessary, knowing table number, row number and columns to find in a cell a figure and to change its color. How it can be made? Ideally on C#.
Here my unsuccessful variants:

Document. Tables [tableNumber].Cell (rowNumber, columnNumber).Select ();
WordApp. Selection. InlineShapes [1].Fill. ForeColor. RGB = System. Drawing. Color. Red. ToArgb ();

2

Re: How program to change a figure background in a table cell?

Qwe. Qwe1;
The matter is that the figure does not become InlineShape even if it is allocated "in the text".
In VBA such construction

 works
ActiveDocument. Tables (1).Cell (3, 1).Range. ShapeRange (1).Fill. ForeColor. RGB =vbred

3

Re: How program to change a figure background in a table cell?

Kazan, thanks, turned out!

var shapes = Document. Tables [tableNumber].Cell (rowNumber, columnNumber).Range. ShapeRange;
if (shapes. Count> = 1)
{
shapes [1].Fill. ForeColor. RGB = (Int32) Word. WdColor.wdColorRed;
}