Extending the original macro a little further, without knowing how many
sections your document contains or whether the sections in that document are
full pages or parts of pages and which of the sections you wish to print
sets a few problems, but the following allows you to select the sections,
one at a time and it will print them individually whether they are full page
or not and keeps offering to print more sections until either all the
sections are printed or you cancel, but it isn't the most elegant of macros.
Sub Print_Choice()
Dim sChoice As Integer
Dim sCurPage As String
Dim sCurSection As String
Dim sSection As String
Dim sPrintCount As Integer
Dim oRng As Range
sCurPage = Selection.Information(wdActiveEndPageNumber)
sCurSection = Selection.Information(wdActiveEndSectionNumber)
On Error Resume Next
sChoice = InputBox("Print the current page or Section" & vbCr & _
"Enter 1 to 4 as appropriate" & vbCr & _
"1. Print current page only" & vbCr & _
"2. Print current section" & vbCr & _
"3. Print choice of sections" & vbCr & _
"4. Print whole document", "Print", 1)
Select Case sChoice
Case Is = 1
ActiveDocument.PrintOut Range:=wdPrintCurrentPage
Case Is = 2
Set oRng = ActiveDocument.Sections(sCurSection).Range
oRng.Select
ActiveDocument.PrintOut Range:=wdPrintSelection, Item:= _
wdPrintDocumentContent, Pages:=""
Case Is = 3
sSection = InputBox("This document contains " & _
ActiveDocument.Sections.Count & " sections" & vbCr & _
"Enter the number of the first section you wish to print", _
"Print", 1)
If sSection <> "" Then
Set oRng = ActiveDocument.Sections(sSection).Range
oRng.Select
ActiveDocument.PrintOut Range:=wdPrintSelection, Item:=
_
wdPrintDocumentContent, Pages:=""
PrintCount = 1
GoAgain:
If ActiveDocument.Sections.Count > 1 Then
sSection = InputBox("Print another section?" & vbCr
& _
"Enter the number of the next section you wish to
print", _
"Print")
If sSection > "" Then
Set oRng =
ActiveDocument.Sections(sSection).Range
oRng.Select
ActiveDocument.PrintOut Range:=wdPrintSelection,
Item:= _
wdPrintDocumentContent, Pages:=""
PrintCount = PrintCount + 1
If PrintCount < ActiveDocument.Sections.Count
Then
GoTo GoAgain
End If
End If
End If
End If
Case Is = 4
ActiveDocument.PrintOut
Case Else
End Select
End Sub
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site
www.gmayor.com
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>