Hello,
I am trying to take a template, loop through a process of finding and replacing certain fields and then merge each individual document that is created into a blank master document.
The template has 2 pages, and I am creating 3 documents to be merged
into the master document for a total of 6 pages.
My problems are with the page numbers.
I found the following post (https://forum.aspose.com/t/78349) and have tried to get the suggested code to work, but have little success.
- When I at first open this Word document, the page numbers on the first page in the Header & Footer are wrong, but as soon as I scroll down to the second page, they correct themselves. Why are they not right when I open the document? I tried using the Document.UpdatePageLayout() method before saving the master document,
but have had zero success. They do re-generate properly when exporting to PDF, but only after the document has been created.
- My ultimate preference is to have the page numbers be 1/2, 2/2, 1/2, 2/2, 1/2, 2/2, 1/2, 2/2 instead of 1/6, 2/6, 3/6, etc. How can I perform this? I have tried the UnlinkFields method that was suggested in the forum, but didn’t have any success with that either. The code would only update some of the fields in the header and I couldn’t get it to update the fields in the footer.
Attached are some of the files including a demo app. Please let me know what else you need.
Thank you for your assistance!