I would like to insert an object after "tab" but I do not know get index end of tab.
- Code: Select all
foreach (Section section in doc.Sections)
{
foreach (Paragraph paragraph in section.Paragraphs)
{
if (paragraph.Text.Contains("[SEARCH]"))
{
if (!paragraph.GetStyle().DefaultStyleType.ToString().Equals("Toc2"))
{
index = section.Body.ChildObjects.IndexOf(paragraph);
tab.Rows[0].Cells[0].Paragraphs[0].Text = "TESTTEST";
tab.Rows[3].Cells[1].CellFormat.Borders.Top.Color = Color.FromArgb(212, 24, 10);
section.Body.ChildObjects.Insert(index + 1, tab);
// GET INDEX END OF TAB HERE
}
}
}
}
thanks in advance for your return.