private static void FixDocument(WordprocessingDocument document) { foreach (var root in document.RecursivePartsRootElements()) { foreach (var cell in root.Descendants<TableCell>().ToList()) { if (!cell.ChildElements.Any(c => !(c is TableCellProperties))) cell.AppendChild(new Paragraph()); } } }