Word: Different Header and Footer for the last page
Solution 1:
Yes, but how easy is a question. It requires a complex field.
You can put that field in your template. Fields are not macros but can seem mysterious. Here is my article on Dealing with Fields. Please read this before attempting to create the needed fields.
This issue of a different last page is addressed in the context of the footer in my chapter on Sections and is easily adapted to either the header or footer.
The required field in your template's header/footer is along the following lines:
In this example { FILENAME \p } is shown on the last page and the page numbering is shown on all other pages. The colors are not needed for field operation but are for illustration.
This is an IF field or a comparison field that compares the current page number with the total number of pages and gives the filename if they are equal and the page numbers if they are not. You cannot simply type this field nor can you use dialogs to create the entire field. Here it is in text:
{ IF { PAGE } = { NUMPAGES } "{ FILENAME \P }" "Page { PAGE } of { NUMPAGES }" }
You may want to use Word MVP Graham Mayor's Add-In to convert the above text to a real field, or insert your own text first and then convert.
You will run into problems if your Section B runs over a page. Consider also whether a StyleRef field would meet your needs. It reports text in the page in the header/footer and only changes when there is new information.
Note, except the link to Graham Mayor's Add-In, links are all to things that I have written/compiled.