Теперь у меня есть этот код:
Код: Выделить всё
object start = 0;
object end = 0;
MSWord.Range rng0 = m_Word_Document.Range(ref start, ref end);
rng0.Text = "Configuration : " + acquisition.Marche.Configuration.NomConfiguration;
rng0.Font.Name = "Times New Roman";
rng0.InsertParagraphAfter();
rng0.Font.Size = 10.0f;
rng0.ParagraphFormat.SpaceAfter = 0.0f;
rng0.Collapse(MSWord.WdCollapseDirection.wdCollapseEnd);
rng0.InsertParagraphAfter();
MSWord.Table theTable = m_Word_Document.Tables.Add(rng0, resultat.Poteau_pk.Length + 1, 1);
theTable.Range.Font.Name = "Times New Roman";
theTable.Range.Font.Size = 10;
theTable.Range.ParagraphFormat.SpaceAfter = 0f;
theTable.Range.Borders.InsideLineStyle = MSWord.WdLineStyle.wdLineStyleSingle;
theTable.Range.Borders.OutsideLineStyle = MSWord.WdLineStyle.wdLineStyleSingle;
theTable.Cell(1, 1).Range.Text = "Poteaux";
for (int i = 0; i < resultat.Poteau_pk.Length; ++i)
{
theTable.Cell(i + 2, 1).Range.Text = resultat.Poteau[i].ToString("F1");
}
rng0.Collapse(MSWord.WdCollapseDirection.wdCollapseEnd);
rng0.InsertParagraphAfter();
rng0.Collapse(MSWord.WdCollapseDirection.wdCollapseEnd);
m_Chart = AddChart(rng0);
[img]https://i.stack.imgur .com/AYwN3.png[/img]
Я не знаю, как установить диапазон за пределами таблицы.
Для меня rng0 не позволяет Не захожу в стол..
Спасибо.
Флоренс.
Подробнее здесь: https://stackoverflow.com/questions/783 ... rd-c-sharp