Hi
I had a file with only a table and I want to insert a paragraph before.
I’m trying:
builder.MoveToDocumentStart();but it’s insert the paragraph into the first cell.
builder.InsertParagraph();
Have you a solution ?
Regards,
Christophe Mari
Hi
I had a file with only a table and I want to insert a paragraph before.
I’m trying:
builder.MoveToDocumentStart();but it’s insert the paragraph into the first cell.
builder.InsertParagraph();
Hi Christophe,
Document doc = new Document(MyDir + “10 lignes.docx”);
DocumentBuilder builder = new DocumentBuilder(doc);
if (doc.FirstSection.Body.FirstChild.NodeType == NodeType.Table)
{
//Insert empty paragraph at the start of document
doc.FirstSection.Body.InsertBefore(new Paragraph(doc), doc.FirstSection.Body.FirstChild);
builder.MoveToDocumentStart();
}
doc.Save(MyDir + "Out.docx");