have to supply several hundred pages of A5, printed at two pages per sheet
on to A4 paper. So far, no problem.
But for some reason that has not been expained to me, I am requred to supply
it with two copies of each page side by side on the A4 sheet. Yes, that's
page 1 side by side with page 1 again on the same sheet, page 2 side by side
with page 2 on the same sheet, and so on.
Crazy or what.... but that's what I'm required to supply. I guess this
might be a VB thing but I don't know enough VB to do it by myself.
Anybody out there got any ideas ??
Hi Kim,
First, go into File > Page Setup. Set the paper size to A4, landscape
orientation, and 2 pages per sheet. (Note that this is *not* the same
as the "2 pages per sheet" in the Print dialog, which should not be
selected.) The pages will be automatically sized to A5.
If you had just a few pages to print, you could now print the doubled
pages by typing into the Pages box in the Print dialog
1,1,2,2,3,3
and so on. With hundreds of pages, this gets just a bit tedious <g>,
so we'll let VBA handle it.
Install this macro in Normal.dot or another global template (see
http://www.gmayor.com/installing_macro.htm) and run it to print the
document.
Sub PrintDoubles()
Dim PageList As String
Dim LastPage As Long
Dim idx As Long, group As Long
With ActiveDocument
LastPage = .Range.Information( _
wdActiveEndAdjustedPageNumber)
For idx = 1 To LastPage
' build list of doubled page numbers
' e.g., "1,1,2,2,3,3,"
PageList = PageList & Format(idx, "##0\,") _
& Format(idx, "##0\,")
' max length of list passed to PrintOut
' is 255 chars, so break off before that
If Len(PageList) > 240 Then
'remove final comma
PageList = Left$(PageList, Len(PageList) - 1)
' print this batch
.PrintOut Background:=False, _
Range:=wdPrintRangeOfPages, _
Pages:=PageList
' reset the list
PageList = ""
End If
Next idx
' do the last batch, if any
If Len(PageList) > 1 Then
'remove final comma
PageList = Left$(PageList, Len(PageList) - 1)
' print this batch
.PrintOut Background:=False, _
Range:=wdPrintRangeOfPages, _
Pages:=PageList
End If
End With
End Sub
Important: This macro assumes that the document's pages are numbered
consecutively from 1 to the last page, with no restarts. If that's not
the case, then the macro needs more code to deal with sections.