I used WordprocessingDocument to add the paragraph at the end of a word after the last paragraph, but I need to add this paragraph at the end of the 15th page in a word document.
Below is my code adding the paragraph at the end of the document:
using (WordprocessingDocument wDoc = WordprocessingDocument.Open(ms, true))
{
gjenerimi = randomstring(14);
var body = wDoc.MainDocumentPart.Document.Body;
var lastParagraf = body.Elements<Paragraph>().LastOrDefault();
var run = new Run();
run.AppendChild(new Text(DateTime.Now.ToString() + " , "));
run.AppendChild(new Text(gjenerimi + " , "));
run.AppendChild(new Text(merreshifren()));
lastParagraf.AppendChild(run);
}