View Single Post
 
Old 12-01-2013, 02:34 PM
jec1 jec1 is offline Windows 7 32bit Office 2013
Advanced Beginner
 
Join Date: Jan 2012
Posts: 84
jec1 is on a distinguished road
Default Odd Even Page Breaks

If you want your new page to start on the next ODD page break you have to specify that in your layout

Your page layout is incorrect. Try the attached.

Even better run this macro:
If desired, you can also create a macro that will step through the document, look at each section, decide how many pages are in the section, and then add a page break at the end of the section, if necessary. The following macro does this very task:


Code:
Sub CheckSecLen() 
    Dim iSec As Integer 
    Dim oRng As Range 
    Dim iValue As Integer 
    With ActiveDocument 
         ' go through each section (except for the last one)
        For iSec = 1 To .Sections.Count - 1 
             ' create a range object at the start of the section
            Set oRng = .Sections(iSec).Range 
            oRng.Collapse wdCollapseStart 
             ' insert a sectionpages field
            .Fields.Add Range:=oRng, Type:=wdFieldSectionPages 
             ' divide the sectionpages field by 2
             ' if it gives a zero as the remainder, then
             ' you have an even number of pages in the section,
             ' which is what you want with an odd section page break
            If (.Sections(iSec).Range.Fields(1).Result Mod 2) <> 0 Then 
                 ' if you have an odd number of pages, then insert
                 ' a page break before the section's section break
                Set oRng = .Sections(iSec).Range 
                With oRng 
                    .Collapse Direction:=wdCollapseEnd 
                    .MoveEnd unit:=wdCharacter, Count:=-1 
                    .InsertBreak Type:=wdPageBreak 
                End With 
            End If 
             ' remove the sectionpages field that was added
            .Sections(iSec).Range.Fields(1).Delete 
        Next iSec 
    End With 
End Sub
Regards
janinecrutch.com
Attached Images
File Type: png Section Start Odd Page.png (51.5 KB, 14 views)

Last edited by macropod; 12-01-2013 at 07:40 PM. Reason: Added code tags & formatting
Reply With Quote