Forum


Replies: 3   Views: 1791
Dynamic text of crossreferences
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by admin  · 27-02-2020 - 15:19

Hello,

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:

https://www.phpdocx.com/api-documentation/word-content/insert-page-number-Word-document-with-PHP

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:

https://groups.google.com/forum/#!topic/microsoft.public.word.numbering/yUNIqiEvjLw

http://www.gmayor.com/installing_macro.htm

There're events that can run macros automatically such as AutoOpen; on the previous page you can read more information about these events.

Regards.