A family of Microsoft word processing software products for creating web, email, and print documents.
Stefen,
Your first suggestion made me think further about the letter content. My letter templates from which the letter is merged do indeed use hidden text to decide whether or not to print the header/footer to allow for printing on plain paper or pre-printed stationary.
In my tests, Word 365 has got Display Hidden Text set and Print Hidden Text cleared in the options. When I set the options to display and print hidden text, I see and print a 3 page document. When I set them both to not display/print the hidden text, I see and print a 2 page document.
There must be the remnants of some hidden text somewhere in the document. I can't find it with Advanced Find, but I suspect it is there somewhere.
My previous versions of Word all had both options set. I assume that this is the default setting and that I had changed the setting on Word 365 which I use on a day-to-day basis.
My page counting code needs to ensure that these settings match. I will modify it to make sure that the options are set to display and print hidden text, because I will always want to export header/footers to PDF to ensure the logos etc. are shown in the document.
Thank you for your help.