Jump to content


Photo

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

Fabian

    Mithril

  • Active Members
  • PipPipPipPipPipPip
  • 2,674 posts
  • Gender:Not Telling
  • Accordance Version:12.x
  • Platforms:Mac OS X, iOS

Posted 23 May 2015 - 07:05 AM

Hello 

 

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

  .Fields.Unlink

  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

  Next

  .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

 

"^p[page:

 

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.

 

 

 

Greetings

 

Fabian

 

 

 

 

 


Greetings

 

Fabian

 

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

 

Mac Air (13-inch, Mid 2013)

1,3 GHz Intel Core i5

4GB Ram

Next time: I'll buy only one with SuperRetina OLED, and hopefully without a glossy screen. A faster CPU, SSD and more RAM.

 

macOS High Sierra 10.13.3

Accordance 12.2.4 and waiting on 13 (on iPad Pro with 3D touch)

 

iPhone X 256GB

iOS 11.2.6

Accordance Mobile 2.6.4.9492






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