1
Ich erstelle dynamisch eine PowerPoint mit C# und ich muss eine Tabelle mit variablen Zeilen und Spalten erstellen Der folgende Code erstellt die Tabelle.Wie fügt man eine Tabelle in PowerPoint mit C# Interop-Bibliothek hinzu?
objShape = MySlide.Shapes.AddTable(10, 5, ConvertCmtoPx(4), ConvertCmtoPx(2.5), ConvertCmtoPx(15), ConvertCmtoPx(10));
table = objShape.Table;
for (int i = 1; i <= table.Rows.Count; i++)
{
for (int j = 1; j <= table.Columns.Count; j++)
{
table.Cell(i, j).Shape.Fill.Solid.SolidFill.BackColor.RGB = 0xffffff;
table.Cell(i, j).Shape.TextFrame.TextRange.Font.Size = 12;
// table.Cell(i, j).Shape.Line.Style.BackColor.RGB = 0xFF3300;
table.Cell(i, j).Shape.TextFrame.TextRange.ParagraphFormat.Alignment = PowerPoint.PpParagraphAlignment.ppAlignCenter;
table.Cell(i, j).Shape.TextFrame.VerticalAnchor = MsoVerticalAnchor.msoAnchorMiddle;
table.Cell(i, j).Shape.TextFrame.TextRange.Text = string.Format("[{0},{1}]", i, j);
}
}
Nun, wie die Tabelle Grenze Stil setzen?
Nach dem Versuch, ist Ihr Code richtig – doo0301