I need to insert multiple images at the end of a word document, each separated by a page break. The image will not be inserted all at once... the code will insert an image, do some other document changes, insert another image at the end of the document, do so other changes, and so on.
Each time I need to insert an image and page break, I do the following:
- Find the last node in the document (where node.NextPreOrderSibling(node.Document) == null).
- Using DocumentBuilder:
This works fine for the first image, but each subsequent pagebreak/image combination gets inserted just before the first image that was inserted (and after the first pagebreak that was inserted). Note that after the first time, each time I find the last node of the document, the node type is Shape.
Do you have any suggestions?