The example Core/addPageNumber/sample_1.php adds a page number that is updated automatically when the DOCX opens. If you try to do the same in the body you need to update it manually; you can read this explained on the API page:
If the page number is not added to a header or footer the user may need to press F9 in the MS Word interface to update its value to the current page.
In our previous reply, we meant that other fields, such as page number, are updated automatically when they are added to headers or footers, but this doesn't happen in all cases. This is a limitation from MS Word and we can't avoid it.
We recommend you to use a macro to update fields automatically:
There're events that can run macros automatically such as AutoOpen; on the previous page you can read more information about these events.