Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-19-2016, 06:18 PM
macropod's Avatar
macropod macropod is offline Word VBA - "Page left Blank" between Sections to make all Sections start on even page Windows 7 64bit Word VBA - "Page left Blank" between Sections to make all Sections start on even page Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default


You really don't need a macro for this. Not only that but using a macro can result in unwanted 'Page left blank' pages when you open or print the document using a different active printer driver.

All you need is a field, coded along the lines of:
{IF{=MOD({PAGE},2)}= 1 "{QUOTE 12}¶
This page intentionally left blank¶
"}
to automatically insert a blank page if the page on which they occur is an odd-numbered one.

To get the same effect for an even-numbered page, change the '1' to '0'.

Such a field would be used with ordinary 'Next Page' Section breaks to separate chapters and placed after the final '.' in each chapter (i.e. immediately before the 'Next Page' Section break).

Note: The field brace pairs (i.e. '{ }') for the above example are all created in the document itself, via Ctrl-F9 (Cmd-F9 on a Mac); you can't simply type them or copy & paste them from this message. Nor is it practical to add them via any of the standard Word dialogues. The spaces represented in the field construction are all required. Instead of the ¶ symbols shown in the examples, you should use real paragraph breaks. Simply format the 'This page intentionally left blank' with however much 'before' spacing you require and apply a centred alignment.

As a bonus, the field code solution obviates the need for the .docm format and any macro security/activation/running issues.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #2  
Old 10-20-2016, 06:45 AM
Cov_ATC Cov_ATC is offline Word VBA - "Page left Blank" between Sections to make all Sections start on even page Windows 7 64bit Word VBA - "Page left Blank" between Sections to make all Sections start on even page Office 2013
Novice
Word VBA - "Page left Blank" between Sections to make all Sections start on even page
 
Join Date: Oct 2016
Posts: 5
Cov_ATC is on a distinguished road
Default

Hi GMayor

Thank you for your help. I have managed to get it to work as you suggested.

HOWEVER, Macropod,

I now am really interested with your Field Code solution.
The only issue: I must then go through the whole document to input the code (with CTRL+F9 many times) to have the code added before all the SectionBreaks. The document is huge and since I can't "copy/Paste", I wondered if there were a way to VBA code the field codes, so that if I click on a button it will run a Sub / End Sub that will have the field code encoded in the Sub and have the vba code to add a sectionbreak?

for instance, something as such: (with the field code actually in a vba format)


Code:
Sub AddNextPageSectionBreakWithFieldCode()
 With Selection
   
    'Field code
    {IF{=MOD({PAGE},2)}= 1 "{QUOTE 12}¶
     This page intentionally left blank¶
    "}

    'Adds a new line
    .TypeParagraph

    'puts a Next Page SectionBreak
    .InsertBreak Type:=wdSectionBreakNextPage

 End With
End Sub
Kind regards,

Cov_ATC



Quote:
Originally Posted by macropod View Post
You really don't need a macro for this. Not only that but using a macro can result in unwanted 'Page left blank' pages when you open or print the document using a different active printer driver.

All you need is a field, coded along the lines of:
{IF{=MOD({PAGE},2)}= 1 "{QUOTE 12}¶
This page intentionally left blank¶
"}
to automatically insert a blank page if the page on which they occur is an odd-numbered one.

To get the same effect for an even-numbered page, change the '1' to '0'.
Reply With Quote
Reply

Tags
automatic, blank page, vba



Similar Threads
Thread Thread Starter Forum Replies Last Post
Word 2010: Section Break "Next" Creates Blank Page Eri Word 11 02-09-2017 03:36 PM
Word VBA - "Page left Blank" between Sections to make all Sections start on even page start SOME sections on new page. drew345 Word 4 12-10-2015 08:34 PM
"Temporary" files that show up on the left of page livemusic Word 4 05-28-2015 04:10 PM
Word VBA - "Page left Blank" between Sections to make all Sections start on even page Mailing: how to make the "page number" in Word is the same as "row number" in excel w Jamal NUMAN Word 1 09-03-2011 11:37 AM
Pesky "Sections Breaks" in word doc Scarlet Word 0 02-09-2011 01:46 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:18 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