Insert section break

B

Bernie Dwyer

Hello! My wife is editing a 327-page book, and is rapidly learning about
some of Word's quirkier features :)

This is Word 2000.

Is there a way to insert a "next page section break" (for chapter
breaks) without having the new section having the "same as previous"
button set (in header and footer), i.e. how to insert a section break
that isn't populated with the same headers and footers as the previous
section? I've done a quick search of this group, some of the other word
groups, and searched word.mvps.org, but no luck.

Is it possible to intercept the "insert break" function with a macro to
do what she wants? If so, has anyone else done it already?

Thanks
 
D

Doug Robbins - Word MVP

Running a macro with the following code when the selection is at the point
where you want to insert the section break will insert the break and unlink
the headers and footers from those in the previous section. Note, the
headers and footers will still contain the same text as those in the
previous section, but it can be edited/deleted without affecting that in the
previous section.

Dim i As Long
Selection.InsertBreak Type:=wdSectionBreakNextPage
With ActiveDocument
i = .Sections.Count
With .Sections(i)
.Headers(wdHeaderFooterFirstPage).LinkToPrevious = False
.Headers(wdHeaderFooterPrimary).LinkToPrevious = False
.Footers(wdHeaderFooterFirstPage).LinkToPrevious = False
.Footers(wdHeaderFooterPrimary).LinkToPrevious = False
End With
End With

If you want the new headers and footers to be blank, use

Dim i As Long
Selection.InsertBreak Type:=wdSectionBreakNextPage
With ActiveDocument
i = .Sections.Count
With .Sections(i)
.Headers(wdHeaderFooterFirstPage).LinkToPrevious = False
.Headers(wdHeaderFooterFirstPage).Range.Delete
.Headers(wdHeaderFooterPrimary).LinkToPrevious = False
.Headers(wdHeaderFooterPrimary).Range.Delete
.Footers(wdHeaderFooterFirstPage).LinkToPrevious = False
.Footers(wdHeaderFooterFirstPage).Range.Delete
.Footers(wdHeaderFooterPrimary).LinkToPrevious = False
.Footers(wdHeaderFooterPrimary).Range.Delete
End With
End With



--
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
 
B

Bernie Dwyer

Doug said:
Running a macro with the following code when the selection is at the point
where you want to insert the section break will insert the break and unlink
the headers and footers from those in the previous section. Note, the
headers and footers will still contain the same text as those in the
previous section, but it can be edited/deleted without affecting that in the
previous section.

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

Great, thanks very much.
 
D

DeanH

If the changes to the header/footer are the text that is reflected in the new
section, i.e. the section/chapter title, then try using StyleRef. You will
not need section breaks, as the header/footer will auto change as the
section/chapter text changes, very useful.
Hope this useful.
DeanH
 

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