Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 12-01-2013, 02:34 PM
jec1 jec1 is offline First section will not 'insert' blank page even though sectn 2 is 'odd' page break Windows 7 32bit First section will not 'insert' blank page even though sectn 2 is 'odd' page break 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, 17 views)

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



Similar Threads
Thread Thread Starter Forum Replies Last Post
First section will not 'insert' blank page even though sectn 2 is 'odd' page break Delete a page after Section Break Next Page Aston Word 9 04-27-2022 07:38 AM
First section will not 'insert' blank page even though sectn 2 is 'odd' page break Section Break (Next Page) replaces Section Break (Continuous) when deleted Carlabasson Word 2 03-25-2013 10:13 PM
First section will not 'insert' blank page even though sectn 2 is 'odd' page break Remove unwanted Page in a Section Break JacobReef Word 1 06-10-2012 07:04 AM
First section will not 'insert' blank page even though sectn 2 is 'odd' page break Help! Section Page Break Not Working - Need new Header and Footers dkgolfer16 Word 2 05-23-2012 11:02 AM
First section will not 'insert' blank page even though sectn 2 is 'odd' page break Page numbering starting on 2 after section break pamm13 Word 1 06-22-2011 11:10 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:51 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft