I’m hitting an issue with extracting contents between two Run’s from this document (specifically the content between the two run’s needs to be duplicated a number of times, as it’s an iteration block).
Strangely the same code seems to work, apart from when both run’s are within the table, but on different rows
The two run’s i’m looking to extract and copy between in this document are “<<&foreach” as the starting Run and “<<&endfor>>” as the ending run.
I’m using the Common.ExtractContents method from the GitHub samples, but if I give it those two nodes it always returns zero nodes. It looks as if both the start and end node are evaluated as the enclosing table.
I have tried manually processing the nodes by following the NextSibling from the start node and recursively processing the node if it has children, but that only seems to give me the three RUN nodes, not any of the cell or row objects, and no containing paragraphs.
If I move the <<&EndFor>> tag so it’s outside the table, the contents extract correctly.
I’ve attached the document that is causing the problems.
If there is an easy way to select between the two runs and ‘copy’ x times that I am missing in the documentation it would be appreciated, as at the moment i’m having to manually process everything, hence having to extract the contents between the nodes.
29843.zip (6.4 KB)
Peter