Improve company productivity with a Business Account.Sign Up

x
?
Solved

Insert formatted blank page before section break?

Posted on 1998-07-11
3
Medium Priority
?
431 Views
Last Modified: 2012-06-22
While Word will put a blank page before a break so the next section starts on an odd page, I do not see a way to have a "blank" page have header/footer and phrase "This page intentionally left blank".  I'm working on a macro, but no luck yet.
0
Comment
Question by:michaelv071198
3 Comments
 

Author Comment

by:michaelv071198
ID: 1612773
Why do I need this? The normal blank page works fine if manuals are double-sided, but I get questions about missing pages if distributed as one-sided so people can make copies.  I used to manually put in the "intentionally left blank" phase as needed, but it adds a lot of proofing time since they always jumped around during editting.
0
 

Expert Comment

by:peterprice
ID: 1612774
I use to run a macro in word 5 to do something similar in that I had a standard header that used sheet numbering within chapter/section etc. I had a macro that I used on that but I found that it was easiest to apply it after writing the document. what I used to do was have the macro insert a Page Break & 'key phrase or character string' with the text I wanted but have that key phrase set to hidden. On editing when the macro was run it would remove all pages from the document that had the key phrase and then start from the beginning of the document inserting new pages with the key phrase and text just before a change of section. I no longer used Word 5 so I have lost the MACRO, but the principle is still valid and it should be possible to  write the same in the latest versions.
0
 
LVL 5

Accepted Solution

by:
tuvi earned 400 total points
ID: 1612775
Here are the macro "InsertDocPrint" that you can use:

Sub InsertDocPrint()
Dim prtDoc As Document
Dim tmpDoc As Document
Dim tmpDocFooter As Range
Dim prtDlg As Dialog
Dim numPage As Long
Dim page As Long
Dim emptyPage As Long

Set prtDoc = ActiveDocument
Set prtDlg = Dialogs(wdDialogFilePrint)
Documents.Add
Set tmpDoc = ActiveDocument
tmpDoc.Content.InsertAfter "This page is intentionally left blank"
Set tmpDocFooter = tmpDoc.Sections.First.Footers(wdHeaderFooterPrimary).Range
tmpDocFooter.ParagraphFormat.Alignment = wdAlignParagraphCenter

On Error GoTo Reset
Application.ScreenUpdating = False

numPage = prtDoc.Content.Information(wdNumberOfPagesInDocument)

page = 1
Do
  prtDoc.Activate
  emptyPage = EvenEmptyPage(page + 1, numPage)
  If emptyPage = 0 Then
    prtDlg.Execute
    page = numPage + 1
  Else
    With prtDlg
      .Pages = Str$(page) & "-" & Str$(emptyPage - 1)
      .Execute
    End With
    tmpDoc.Activate
    tmpDocFooter.Text = "Page " & Str$(emptyPage) & " of " & Str$(numPage)
    prtDlg.Execute
    page = emptyPage + 1
  End If
Loop While page <= numPage

tmpDoc.Close wdDoNotSaveChanges
prtDoc.Activate

Set tmpDoc = Nothing
Set tmpDocFooter = Nothing
Set prtDoc = Nothing
Set prtDlg = Nothing

Reset:
  Application.ScreenUpdating = True
End Sub

Private Function EvenEmptyPage(ByVal startPage As Long, numPage As Long) As Long
  Dim startRange As Range
  Dim endRange As Range
  Dim pageRange As Range
  Dim evenPageNumber As Long
  Dim found As Boolean
 
  If (startPage Mod 2) = 1 Then
    startPage = startPage + 1
  End If
 
  If startPage > numPage Then
    EvenEmptyPage = 0
    Exit Function
  End If
 
  found = False
  Do
    Set startRange = ActiveDocument.GoTo(wdGoToPage, wdGoToAbsolute, startPage)
    Set endRange = ActiveDocument.GoTo(wdGoToPage, wdGoToAbsolute, startPage + 1)
    Set pageRange = ActiveDocument.Range(startRange.Start, endRange.End)
 
    If Len(pageRange.Text) = 0 Then
      found = True
    Else
      startPage = startPage + 2
    End If
  Loop While (startPage <= numPage) And Not found
 
  If found Then
    evenPageNumber = startPage
  Else
    evenPageNumber = 0
  End If
 
  Set startRange = Nothing
  Set endRange = Nothing
  Set pageRange = Nothing
 
  EvenEmptyPage = evenPageNumber
End Function
---------------------------------
The idea is check for empty even page, then print an empty document with the note: "This page is intentionally left blank"
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

As a person who answers a lot of questions, I often see code that could be simplified, made easier to read, and perhaps most importantly made easier to maintain if the code was modified to use the Select Case statement. This article explains how to…
This is a comprehensive review of a bundled Toolkit designed for use by IT Professionals and End Users to help Microsoft Outlook fans manipulate Outlook files and repair some common problems. Enjoy...
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
How can you see what you are working on when you want to see it while you to save a copy? Add a "Save As" icon to the Quick Access Toolbar, or QAT. That way, when you save a copy of a query, form, report, or other object you are modifying, you…

607 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question