Word 2007: Insert an odd page break before each Heading 1December 15, 2010
I’m testing setting up a template for a potentially very large Word document (hundreds of pages) that will be printed and bound. I want each section/chapter to start on a new, odd page, so I want to associate an odd page section break with my Heading 1 style.
Problem: You can’t do this in Word! You can easily insert a page break before a style, but not a section break. Go figure…
However, you can create a macro that will insert an odd page section break in front of your Heading 1 style. Please note: If you use the Heading 1 style for anything other than your new chapter/section heading, the odd page section break will apply to that too.
The macro below is modified from the one I found here: http://thedailyreviewer.com/windowsapps/view/inserting-a-section-break-before-each-heading-level-1-automatically-10694987
This macro inserts an odd page section break before a Heading 1 style.
Sub InsertOddPageSectionBreak() Dim rngDcm As Range Dim rngTmp As Range Set rngDcm = ActiveDocument.Range With rngDcm.Find .Style = "Heading 1" While .Execute rngDcm.Select ' for testing only Set rngTmp = rngDcm.Duplicate rngTmp.Collapse rngTmp.Select ' for testing too If Asc(rngTmp.Characters.First.Previous) <> 12 And _ Asc(rngTmp.Characters.First) <> 12 Then rngTmp.InsertBreak Type:=wdSectionBreakOddPage End If rngDcm.Collapse Direction:=wdCollapseEnd Wend End With End Sub
You can modify it to apply to any named style (replace Heading 1 in the quote marks with any other named style, and you can modify the type of break that’s inserted (e.g. change wdSectionBreakOddPage to wdSectionBreakNextPage).
Thanks to Helmet Weber (Microsoft Word MVP) whose macro pointed me in the right direction.
[Link last checked December 2010]