Page numbering in multiple documents

O

oe

I have to put page numbers in specifications which are compiled of several
separate documents, e.g.

Cover Sheet (Page 1 but not numbered)
Document1 - Preliminaries (pages 2-9)
Document 2 - Preambles (pages 10-20)
Document 3 Schedule (pages 21-50)

This is OK until the documents have amendments, omissions or additions.

Is there any way of updating the page numbers without having to open the
footer of each document and adjusting the number on the first page, please?
 
D

Doug Robbins - Word MVP on news.microsoft.com

A 50 page document is by no means a large document. Why not just combine
them all into one document?

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 
O

oe

They are separate because they are based on different templates. It would be
quite a complicated task to combine all the templates now.
 
D

Doug Robbins - Word MVP on news.microsoft.com

One would expect consistent formatting throughout such a document and if
proper use was made of styles, combining them all into one should not be an
issue.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 
O

oe

Yes, usually I would agree but in this case, the layouts of the different
documents are so different.

Perhaps if I were starting from 'scratch', it may be possible to create
styles to cover all the items but Heading 1, say, in Document 1 is very
different from in the other documents, particularly in the paragraph
following Heading 1, similarly Heading 2 and Heading 3, etc.

Sorry I can't explain very well but, presumably, it is not then possible to
update the page numbers in the footers as I needed?
 
D

Doug Robbins - Word MVP on news.microsoft.com

It is not something that can be done without using some Visual Basic (VBA)
Code

If you have each of the individual documents in a separate section in the
assembled document, with the page numbers of each section formatted to start
at 1, and after assembling the document, you run the following macro:

Dim i As Long
With ActiveDocument
For i = 1 To .Sections.Count - 1
.Variables("Section" & i & "pages").Value =
..Sections(i).Range.Information(wdActiveEndPageNumber)
Next i
End With

And starting with Section 2, you have the following field construction where
you want the page number to appear

{ = { DOCVARIABLE Section1Pages } + { PAGE } }

where you change the 1 to 2 in Section 3 and so on, then, we the fields in
the document are updated by doing a print preview or printing the document,
the page numbers should be continuous throught the document

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 
O

oe

Thanks, I will try that.

Doug Robbins - Word MVP on news.microsoft.com said:
It is not something that can be done without using some Visual Basic (VBA)
Code

If you have each of the individual documents in a separate section in the
assembled document, with the page numbers of each section formatted to
start at 1, and after assembling the document, you run the following
macro:

Dim i As Long
With ActiveDocument
For i = 1 To .Sections.Count - 1
.Variables("Section" & i & "pages").Value =
.Sections(i).Range.Information(wdActiveEndPageNumber)
Next i
End With

And starting with Section 2, you have the following field construction
where you want the page number to appear

{ = { DOCVARIABLE Section1Pages } + { PAGE } }

where you change the 1 to 2 in Section 3 and so on, then, we the fields in
the document are updated by doing a print preview or printing the
document, the page numbers should be continuous throught the document

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 
O

oe

I tried that but it still leaves the problem that, as the separate documents
were based on different templates, the formatting gets messed up when they
are assembled.
 
D

Doug Robbins - Word MVP on news.microsoft.com

As I said before, one would expect consistent formatting throughout such a
document and if
proper use was made of styles, combining them all into one should not be an
issue.


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 

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