How do I insert a page number in Word that copies and pastes?

arthurh88
arthurh88 used Ask the Experts™
on
I create a text box in word.  I insert the page number.   I then copy that text box, complete with the page number, to a new page.  The new page shows the old page number, not the new one.  How can I create a text box with a variable page number that will show the page number whereever I copy/paste that text box?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
The page number is a field and before it shows the correct page, it needs to be updated. Normally, if you wanted to update all fields at once you would select the entire document (Ctrl+A) and then press F9. This, however, will not work for a field within a text box. You can go to each text box, right-click field and select Update Field; or you can run this macro:
Sub UpdateTBFlds()
Dim shp As Shape
  For Each shp In ActiveDocument.Shapes
    With shp.TextFrame
      If .HasText Then
        .TextRange.Fields.Update
      End If
    End With
  Next
End Sub

Open in new window

Paul
Dimitris MaleasData recovery engineer

Commented:
insert a PAGE field with Alt+Shift+P to first text box.Copy/paste and right click in number --> update field
John KorchokProduction Manager

Commented:
Let's keep it simple! In the text box, right-click on the page number field and choose Update Field.

Author

Commented:
that macro is slick.  thank you!
You're welcome. Glad it worked out for you.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial