Link to home
Start Free TrialLog in
Avatar of Chris Belcher
Chris Belcher

asked on

How do I split up a large document into smaller files while keeping page numbering

I have a large document with 20+ chapters. Each chapter has own header with chapter title and a footer with page number. My client has to publish the whole doc as well as each chapter separately on their website. How can I split the doc into chapters and maintain the header and footer page numbering as related to the original document? Cannot be in PDF.
Avatar of Paul Sauvé
Paul Sauvé
Flag of Canada image

when you split the large file into 20+ documents, use the automatic page numbering:

In each document:

insert tab ―> Header & Footer group ―> Page Number options  ―> Format Page Numbers

in the Page Numbering options, select Start at and insert the corresponding page number of the page of each chapter on the original document
Avatar of Chris Belcher
Chris Belcher

ASKER

Thanks Paul, I had thought of that but it is quite a manual process so I was hoping Word might offer something easier. Thanks for your quick response.
If you are indicating that each page number is typed in manually then you have a lot of work to do no matter how you approach this problem. The correct method is how Paul has indicated. This will allow Word to "Manage" the pagination on the fly and you have many options when you do this. There may be a programmatic way to resolve this in VBA but that is a big maybe. Can you post some sample pages so the layout can be viewed? Remove any private details before you do.
by default, auto page numbering in Windows starts at 1.

at best, you can automate (with a macro):

Insert tab ―> Header & Footer group ―> Page Number options  ―> Format Page Numbers ―> Page Numbering options

then all you have to do is insert the page number
EDIT:
Create or run a macro

Applies To: Word 2016 Word 2013 Word 2010 Word 2007
https://support.office.com/en-us/article/Create-or-run-a-macro-c6b99036-905c-49a6-818a-dfb98b7c3c9c
You could try a macro like this.
Sub SplitDocAtSections()
    Dim sec As Section
    Dim docMain As Document
    Dim docSub As Document
    Dim rng As Range
    Dim p As Integer
    
    Set docMain = ActiveDocument
    For Each sec In docMain.Sections
        
        Set rng = sec.Range
        rng.MoveEnd wdCharacter, -1 'step back from section break
        rng.Copy
        
        Set docSub = Documents.Add
        
        docSub.Range.Paste
        sec.Headers(wdHeaderFooterPrimary).Range.Copy
        With docSub.Sections(1).Headers(wdHeaderFooterPrimary)
            .Range.Paste
            .PageNumbers.RestartNumberingAtSection = True
            .PageNumbers.StartingNumber = p + 1
        End With
        docSub.SaveAs Replace(docMain.FullName, ".doc", "_" & sec.Index & ".doc")
        p = p + docSub.Range.Information(wdNumberOfPagesInDocument)
        docSub.Close
        
    Next sec
End Sub

Open in new window

Note that the macro assumes that the chapters are mapped to document Sections and that the document only uses the Primary header, i.e. 'Different odd and even' and 'Different first page' on the  Layout tab of the PageSetup dialogue are not checked.
It would need some tweaking if the document is different from that.
I am an editor and very unfamiliar with macros. The splitting and then manually restarting the first page number for each file works. Its not TOO cumbersome as I have only 14 chapters.

I'll give the macro a go for my own learning.

Thank you all for helping me out :-)

Chris
i'm afraid to say that the choices are manually or running a macro
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.