public void CopyTableToFooter() { using (var doc = WordprocessingDocument.Open(TemplatePath, true, new OpenSettings { AutoSave = false })) { var table = new WordDocumentTable(doc); table.Select("Table1"); var footer = doc.MainDocumentPart.FooterParts .Select(f => f.Footer) .LastOrDefault(); var source = new PrintObject(table.Table); var dest = new PrintObject(footer); Assert.AreEqual(footer.Descendants <Table>().Count(), 0); source.CopyTo(dest); Assert.AreEqual(footer.Descendants <Table>().Count(), 1); } }
public IPrintObject CopyTo(IPrintObject destPrintObject) { var sourceObject = new PrintObject(XmlElement); return(sourceObject.CopyTo(destPrintObject)); }