I think the problem is in your Body.InsertAfter statement. Look at
http://openxmldeveloper.org/blog/b/openxmldeveloper/archive/2011/04/11/137431.aspx[
^] where Eric White uses this routine
static void AppendPageBreak(WordprocessingDocument myDoc)
{
MainDocumentPart mainPart = myDoc.MainDocumentPart;
OpenXmlElement last = myDoc.MainDocumentPart.Document
.Body
.Elements()
.LastOrDefault(e => e is Paragraph || e is AltChunk);
last.InsertAfterSelf(new Paragraph(
new Run(
new Break() { Type = BreakValues.Page })));
}
you dont append to the body, but the last element. regards, me.