Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inseert new 'blank' page after every 3rd page MSWord 2003 1

Status
Not open for further replies.

aarondewberry

IS-IT--Management
Jul 20, 2005
148
0
0
GB
Hi all

I have a word document that is around 200 pages long. Due to duplexing issues whilst printing, after page 3, I need to insert a new blank page. I need to do this after every third page. So basically I will end up with a new blank page 4,8,12,16 etc...
Note, I want to keep the original page 4, 8, 12 etc... They will just move up a page and become 5, 9, 13 etc..
Hope i'm making sense!
Can this be done...? I am stuck!
 
More info: The word document is split into sections. There are 3 pages in every section. So I just need to add a page break to the last page in every section.

Thanks
 
Hi aarondewberry,

Is there a reason you can't simply print the document in blocks of 3 pages? This would have the same effect on the printout as inserting extra pages, but without the need to modify the document. A macro you could use to automate this is:
Code:
Sub PrintMe()
Dim i As Integer
With ActiveDocument
  For i = 1 To .ComputeStatistics(wdStatisticPages)
    If i Mod 3 = 0 Then .PrintOut Pages:=i - 2 & "-" & i, Copies:=1
  Next
  If .ComputeStatistics(wdStatisticPages) Mod 3 <> 0 Then
  i = Int(.ComputeStatistics(wdStatisticPages) / 3) * 3 + 1
    .PrintOut Pages:=i & "-" & .ComputeStatistics(wdStatisticPages), Copies:=1
  End If
End With
End Sub
Of course, if your document already has Section breaks every 3rd page (as would be the case if the document is the result of a letter mailmerge), you could use:
Code:
Sub PrintMe()
Dim i As Integer
With ActiveDocument
  For i = 1 To .Sections.Count
    .PrintOut Pages:="s" & i, Copies:=1
  Next
End With
End Sub


Cheers
[MS MVP - Word]
 



StartPage = (Section - 1) * 3 + 1
EndPage = StartPage + 2

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
While the above solutions do indeed (possibly) solve your issue in terms of printing, if you still actually wish to do what you asked -
I need to insert a new blank page. I need to do this after every third page.
AND the following is totally accurate -
There are 3 pages in every section. So I just need to add a page break to the last page in every section.
the following does that. It adds a page break at the end of every Section.
Code:
Sub AddPageEachSection()
Dim r As Range
Dim oSection As Section
For Each oSection In ActiveDocument.Sections
   Set r = oSection.Range
   With r
      .Collapse 0
      .Move Unit:=wdCharacter, Count:=-1
      .InsertBreak Type:=wdPageBreak
   End With
Next
End Sub

"A little piece of heaven
without that awkward dying part."

advertisment for Reese's Peanut Butter Cups (a chocolate/peanut butter confection)

Gerry
 
Hi Gerry,

Somewhat more efficiently:
Code:
Sub AddPageEachSection()
Dim oSection As Section
For Each oSection In ActiveDocument.Sections
   oSection.Range.Characters.Last.InsertBefore Chr(12)
Next
End Sub


Cheers
[MS MVP - Word]
 
Hoo-hoo!

Indeed. I like it. I always like code to be more efficient. A star to you sir.

Gerry
 
To macropod, BTW, are you attending the MVP-fest in February? It would be good to meet you.

Gerry
 
Hi Gerry,

No, I won't be there - there's no way I could justify the expense.


Cheers
[MS MVP - Word]
 
I understand. It is a lot easier for me, as I am only a fairly short drive away.

Gerry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top