This is a tricky one. If your page orientation is different throughout the
document, you obviously have sections breaks to have certain pages in
portrait and other pages in landscape or whatever the case may be but you
must have section breaks else you will change the header throughout the
document and not just in a specific section. Go to View, Headers and Footers,
Inside the header or footer click on the insert page number option on your
header toolbar, press Return to have a blank line or two and press ALT+F9 to
see your field codes being displayed as {PAGE } instead of the page number.
Still in your header, click on insert, text box, draw the text box and copy
this {PAGE } field into the text box. Your text box toolbar will appear.
Choose the last option which is to rotate text in the text box. Format the
text box to remove the lines around the text. Delete the original {PAGE }
which you started off with (which was outside the text box).