2. Immediately under the Insert option, click "Shape" and select the "Rectangular" style;
Then you can draw a rectangle at the page number. Then, in the format options of the drawing tool, click "Text Wrap" and select "Underlining Text". You can also adjust the style of the rectangular box here.
4. The final setting has the following effect (enlarge the page number).