View Single Post
 
Old 11-04-2013, 09:02 PM
fumei fumei is offline Windows 7 64bit Office XP
Expert
 
Join Date: Jan 2013
Posts: 440
fumei is on a distinguished road
Default

And further, rather than all those lines of printing you could use anothwer subroutine:
Code:
Sub DoThePrinting(ThePages as String)
Application.PrintOut FileName:="", Range:=wdPrintRangeOfPages, Item:= _
       wdPrintDocumentWithMarkup, Copies:=1, Pages:=ThePages, PageType:= _
       wdPrintAllPages, Collate:=True, Background:=True, PrintToFile:=False, _
        PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _
        PrintZoomPaperHeight:=0
End Sub
Now you can do all your print jobs as:
Code:
'Print Sections
If cbLocations.Value = "True" Then
  Call DoThePrinting("1,2-14")
ElseIf cbPitPipe.Value = "True" Then
  Call DoThePrinting("1,15-31")
 
etc. etc.
BTW: you are for each pint job calling up the display of the dialog. Why? You are sending print job via code, so why have the displayed dialog.
Reply With Quote