Page Numbers in every document

  • Thread starter Thread starter chaucersmom
  • Start date Start date
C

chaucersmom

I want page numbers to automatically be inserted into every new document.
How can I accomplish this?
 
Modify your normal.dot(x) template to include a page number (in a
header or footer).

You do that differently in different versions of Word.
 
There are implications in doing this in the normal template (normal.dotm in
2007) and while it will achieve the user's request as written, it will be no
longer possible to (say) create labels using the labels tool. It is better
to either create a second template configured as required and create
documents with page numbering from that template, or create a macro that
will add page numbers to the document e.g.

Sub NumberPages()
Dim oRng As Range
Dim oSection As Section
Dim oFooter As HeaderFooter
For Each oSection In ActiveDocument.Sections
For Each oFooter In oSection.Footers
If oFooter.Exists Then
Set oRng = oFooter.Range
With oRng
.Fields.Add oRng, wdFieldPage, , False
.InsertBefore "Page "
.InsertAfter " of "
.Collapse wdCollapseEnd
.Fields.Add oRng, wdFieldNumPages, , False
.ParagraphFormat.Alignment = _
wdAlignParagraphCenter
End With
End If
Next oFooter
Next oSection
End Sub
End Sub

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
Thank you for your advice not to change the normal.dot template. I easily
set up a separate template with the page numbering I use for my documents.
Once I figure out how to include a macro in 2007, I might try that method.
Follow-up question: is there any way to use my newly created template as the
default template for every document that I create or must I select it every
time?
 
The simplest way to base new documents on your custom template is to make a
desktop shortcut to the template (right-click the template's icon in the
Computer app, and choose Send To > Desktop). When you double-click the icon,
Word will start up with a "blank" document based on your template.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so all
may benefit.
 
The alternative to Jay's suggestion is to create the macro you were
wondering about. You could use the macro recorder or create something
similar to

Sub MyTemplate()
Documents.Add Template:= _
"D:\Word 2007 Templates\MyTemplate.dotm", NewTemplate:=False _
, DocumentType:=0
End Sub

in which you would insert the exact path and name of your template in place
of
D:\Word 2007 Templates\MyTemplate.dotm

then http://www.gmayor.com/installing_macro.htm will show you how to add the
macro to the QAT (Quick Access Toolbar) for one click creation of documents,
using your template, from within Word.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
Back
Top