View Single Post
 
Old 05-23-2022, 04:11 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,166
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Your code is applying the trays to the selection rather than the document as a whole. Try this variation to make the trays independent of the selection when you run the macro.
Code:
Sub Section()
  With ActiveDocument.PageSetup
    .FirstPageTray = wdPrinterLowerBin
    .OtherPagesTray = wdPrinterMiddleBin
  End With
  If ActiveDocument.Sections.Count > 9 Then
    Application.PrintOut Range:=wdPrintRangeOfPages, Item:=wdPrintDocumentWithMarkup, Copies:=1, Pages:="S1-S10", _
          PageType:=wdPrintAllPages, Collate:=True
  Else
    Application.PrintOut Range:=wdPrintAllDocument, Item:=wdPrintDocumentWithMarkup, Copies:=1, _
          PageType:=wdPrintAllPages, Collate:=True
  End If
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote