Jump to content


How to: Add Page Numbers to Word for User Tools.

How to User Tools Page numbers

  • Please log in to reply
No replies to this topic

#1 Fabian



  • Super Member
  • PipPipPipPipPipPip
  • 4,711 posts
  • Gender:Not Telling
  • Accordance Version:13.x
  • Platforms:Mac OS X, iOS

Posted 23 May 2015 - 07:05 AM



The problem is, that the Page Numbers from the footer from the Word .docx files are not implanted in the file itself. Only the Page-breaks and the total amount of pages.


So we need a Makro for doing this.


Go to http://www.msofficeforums.com/word-vba/15309-macro-add-text-page-number-top-each.html

and copy the 


Sub ApplyPageNos()

Application.ScreenUpdating = False

Dim Rng As Range, i As Long, StrTxt As String

StrTxt = "Page: "

With ActiveDocument


  For i = (.ComputeStatistics(wdStatisticPages) - 1) To 1 Step -1

    Set Rng = .GoTo(What:=wdGoToPage, Name:=i)

    Set Rng = Rng.GoTo(What:=wdGoToBookmark, Name:="\page")

    With Rng

      .End = .End - 1

      If .Characters.Last.Text <> Chr(13) Then

        .Characters.Last.InsertAfter vbCr

      End If

      .InsertAfter vbCr & StrTxt & i + 1

    End With


  .Range.InsertBefore vbCr & StrTxt & "1"

End With

Set Rng = Nothing

Application.ScreenUpdating = True

End Sub


open Word and open the preferences. Here tick on the "Development tools" and open in Word a new Makro. And create one with the Makro above. Maybe you have to see the help files.


Test it with a file. If its work. Then I think there is some additional steps.


Open in Word the extended "Search and Replace" and tick here the "Regular expression" or "Regex" or "Pattern Search". Put 


"^13page: ([0-9]@)^13" 


 without quotation marks) in the  search field and replace it with


" [page: \1]"

(also without quotation marks)


If the replace field is active then go to the Format and on the first settings, you can choose "color". Take here the green which Accordance use for Pages.


Run the "all replace".


Then run a new search and replace. Without the "Pattern search" is tick. 


"  [page:"


and replace




this also without the quotation marks but even with the color green in the Format section. 


On the end. Go to the beginning of the file and maybe you want to delete the [page: 1].


Save it as .html and install it in Accordance.



How you can see in the link above they also preferred to save the document als pdf and then copy-paste from there. Then you have absolut the correct page number, but you have to edit the file.



Maybe one tech guy here have a better solution. 


Unfortunately Accordance doesn't support the color if you import it as html. 


Unfortunately Accordance doesn't support the green [page: ...] as new search option in the User Tools.














ATTENTION: My bug reports are all with the GERMAN INTERFACE and with the EUROPEAN NOTATION! It can be the English interface has no bugs, I describe.

Bring more international Bibles to the store,
fix my reported bugs, even the old ones which never was addressed,
develop my feature requests, the new once and the once I made years ago,
in nearer future.

Also tagged with one or more of these keywords: How to, User Tools, Page numbers

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users