I have Document file with header and footer part. In the footer portion I have one table.
So now I am trying insert text into Table cell. But whenever I try to do by this code it will be append paragraph type and change the height and weight of the table .
using (WordprocessingDocument wordDoc = WordprocessingDocument.Open(ORiFilepath, true))
{
var docPart = wordDoc.MainDocumentPart;
MainDocumentPart mainPart = wordDoc.MainDocumentPart;
if (docPart.FooterParts.Count() > 0)
{
//List<Table> table = docPart.FooterParts..Elements<Table>().ToList();
foreach (FooterPart footer in docPart.FooterParts)
{
List<Table> table = footer.Footer.Elements<Table>().ToList();
if (table.Count > 0)
{
var footertable = table[0];
TableRow row1 = footertable.Elements<TableRow>().ElementAt(1);
string text1 = cell1.InnerText;
if (text1 == "")
{
cell1.Append(new Paragraph(new Run(new Text("TEXT"))));
}
}
}
}
}
can I insert text into the cell Using
cell1.Append(new Paragraph(new Run(new Text("TEXT"))));,
or What should be the method ?