When I run the following code in a .docx file, child2.innerText will print the information I get after (although not separating the text from the individual columns of the table).
My problem is that the innerXml associated with this is completely incomprehensible to me. I thought there would be a get cell from table method or such. I have no idea how to extract columns / rows from the xml that gave me.
I am completely new to C #, so I may miss something obvious. I am using openxml and a .docx file.
using (WordprocessingDocument wdoc = WordprocessingDocument.Open(pathToMiniToktrapport, false)) { var table = wdoc.MainDocumentPart.Document.Body.Elements<Table>(); foreach (var child in table) { foreach (var child2 in child) { System.Console.WriteLine(child2.InnerXml); System.Console.WriteLine(child2.InnerText); System.Console.ReadLine(); } } }
Thanks!
source share