How: Agregar múltiples tablas en Word con .net
Intento agregar tablas múltiples dentro de un documento de Word usando c #
// Tables is a list of items which I want to present each in a table
foreach (List<string[]> ClassTable in Tables)
{
// tbl is a "Microsoft.Office.Interop.Word.Table"
// myRange is like MyDoc.Range(ref missing, ref missing)
tbl = MyDoc.Tables.Add(myRange, ClassTable.Count(), 3, missing, missing);
tbl.Borders.Enable = 1;
RowCounter = 1;
foreach (string[] item in TableContent)
{
ColumnCounter = 1;
foreach (string str in item)
{
tbl.Cell(RowCounter, ColumnCounter).Range.Text = str;
ColumnCounter++;
}
RowCounter++;
}
}
este código agrega solo una tabla, cada vez que en el segundo ciclo debería crear otra tabla y agregar los siguientes valores de elementos en
Intento cambiar el Rango con set myRange.start o myRange.setRange () ... etc. Todos fallan solo una tabla agregada al evento del documento si crea muchas filas en una tabla pero no en varias tablas