Automatic Page Numbers across Multiple Documents

J

joanna28waszczuk

Hi,

I found that very usefull code on this vebside (http://wordribbon.tips.net/T011572_Automatic_Page_Numbers_across_Multiple_Documents.html).

But the numbers doesn't look good (it is like page 12 on the left side). I would like to have just numbers in the centre (font palatyno linotype, 11). I was looking for some solutions for that problem but I couldn't find them.
If You have any ideas, please write me a message.

Joanna W.

here is that code:

Sub PageNumberReset()
Dim pgNo As Long
Dim n As Long
Dim pathName As String
Dim fileNames
Dim thisFile As String
Dim aRange As Range

' Specify the path to the document files
pathName = "C:\MyDocs\Example\"
' Create an array holding the document file names, in sequence
fileNames = Array("Chap1.docx", "Chap2.docx", "Chap3.docx")

pgNo = 0
For n = 0 To UBound(fileNames)
thisFile = pathName & fileNames(n)
Application.Documents.Open (thisFile)
ActiveDocument.Sections(1).Headers(1).PageNumbers.StartingNumber = pgNo + 1
Set aRange = ActiveDocument.Range
aRange.Collapse Direction:=wdCollapseEnd
aRange.Select
pgNo = Selection.Information(wdActiveEndAdjustedPageNumber)
Application.Documents(thisFile).Close Savechanges:=wdSaveChanges
Next n
End Sub
 
Top