template: first page is misnumbered

B

Barbara White

I am using Word 2000 on Windows 2000.

I have a .dot/template file that contains several sections.

The first section governs the layout of the Table of Contents, List of
Figures, and List of Tables.

The second section is where the actual body of the report starts. In the
footer, its page number is set to "restart at 1".

If I update the .dot file and then save/exit it, all is well in that the
Table of Contents reflects the correct page number for the first page of
this second section.

However, when I use the template (double-click on it to get a blank
document that is based on the template), the first page number in that
second section is listed as "3" instead of "1".

If, in the blank file, I select all and update the ToC, then the number
changes to "1".

If I open the .dot file (open it, rather than use it as a template),
then the page numbering in the ToC is correct. The only time the ToC
page numbering goes wonky is when I actually use the .dot file as a
template.

How can I make the page number "stick" in the template's ToC?
 
S

Shauna Kelly

Hi Barbara

The only way I know how to solve this problem is with a macro, as follows.

Open your template file. Alt-F11. You're now in the Visual Basic Editor.

On the left, you should see a list of all currently open documents and any open add-ins. If you don't see this, do View > Project
Explorer.

In that list on the left, locate your file. Expand the list of folders till you see "ThisDocument". Double-click it.

In the big pane on the right, click where it says (General). Choose Document. Word will insert the following:
Private Sub Document_New()

End Sub

Between the text that Word inserted, type so you see:

Private Sub Document_New()
ActiveDocument.Fields.Update
End Sub

File > Close to return to your template. And save the file.

That code will run each time a new document is created from the template. Rather obviously, it updates all fields (including the TOC
field) in the document.

If this template resides in the User Templates or Workgroup Templates file locations, then this code won't trigger a macro security
warning when users create a new file from the template.

Hope this helps.

Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word
Melbourne, Australia
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top