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?
2 Answers
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.
- 30,396
- 15
- 136
- 260
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:
- Just type "Page" then leave a space
- 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.
- 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.