2

I am trying in publisher to add something like Page 1 of 10 in the header of Publisher. If I am looking at the Master Page all I see is an Insert Page Number button which gives me the current page number. There is nothing to show the Total Page count. How do I add something like Page 1 of 10 in the header of a Publisher document?

Linger
  • 3,274
  • 10
  • 35
  • 47
  • I've never used Publisher but does it have anything similar to [fields in MS Word](https://support.office.com/en-us/article/add-page-number-x-of-y-to-a-document-1f273c7c-661c-4444-97b5-c7ec07270f16) for custom page numbering? – phuclv Sep 27 '18 at 03:59

2 Answers2

2

This question hasn't gotten a response so far, so I'll answer from a Publisher 2010 perspective. In 2010, there is no total pages as there is in Word, but a macro can be run:

Sub NumberT()
Dim strPageNumber As String
     Dim x As Integer
     For x = 1 To Pages.Count
           With ActiveDocument.Pages(x)
           strPageNumber = .PageNumber
          .Shapes.AddTextbox(Orientation:=pbTextOrientationHorizontal, _
             Left:=490, Top:=50, Width:=80, Height:=20) _
            .TextFrame.TextRange.InsertAfter NewText:="Page " _
            & strPageNumber & " of " & .Parent.Count & " "
    End With
Next x
End Sub

I modified this code based on a post from Add number of pages after page number on the Microsoft forum. You'll want to change the value for Left and Top depending upon page margins and font size. As written this code puts the page number in the upper right of a portrait letter page with a 1-inch margin.

This workaround is definitely a last resort, as it creates text boxes on every page with hard-coded page information and would best be run at the end of all editing. The text boxes holding the numbering would need to be manually deleted before re-running the macro.

phuclv
  • 26,555
  • 15
  • 113
  • 235
  • I up-voted you for the effort. I probably won't try it. It seems to complicated just for a total page count. I will likely just manual type the total pages in the master page. Thanks for your time. – Linger Mar 13 '17 at 11:15
  • Understood. The people I work with change their minds on content frequently and want to root around in the source file, so maintenance would be an issue. However, at least a search and replace for "of X" might save time in some instances. Upvote quite appreciated! –  Mar 13 '17 at 15:53
0

You can D-I-Y one if you know the total page count. Think about it this way - the only variable is the page you're on right now, the total never changes. SO Step 2 of the process below takes care of the only variable. FYI This will work in the header, footer, or body:

  1. Just type "Page" then leave a space
  2. Use the Page Number tool on the Insert tab - since you're typing in the header/footer/body, just use the "Insert in Current Text Box" function second from the bottom of the drop down menu OR simply push "i" after you click on the Page Number tool.
  3. Now that you've inserted the only variable, just put a space in and type "of" then the total number of pages. Since the total number of pages never changes, it won't matter that it's the same on every page.

Your end product will look something like - Page # of 10 (or whatever your total may be - the "#" appears when you use the insert page number tool)

Just click to apply it to all pages, save your doc, and be amazed by your amazingness.

  • Why would the total number of pages never change? – Blackwood Sep 27 '18 at 03:01
  • Unless you revise Document X, and Doc X has 10 pages total, Doc X will always have a total of 10 pages. I.E. you don't need a variable to say "of 10" because you can just type it. – Karl Gamradt Sep 27 '18 at 03:21
  • Precisely. If you revise the document and it now has 11 pages, your method would have the last page numbered "Page 11 of 10". – Blackwood Sep 27 '18 at 07:11