I want to edit the values in rows of table in doc file using openxml package in c sharp code. Here I am showing the code for finding table but it gives me null and if i use default instead of firstordefault then its gives me exception like sequence contains no elements.
DocumentFormat.OpenXml.Wordprocessing.Table table=doc.MainDocumentPart.Document.Body.Elements<DocumentFormat.OpenXml.Wordprocessing.Table>().FirstOrDefault();
Thanks.
You can use this: Table table = doc.MainDocumentPart.Document.Descendants().FirstOrDefault();