![]() |
#3
|
||||
|
||||
![]()
Using Select Case allows you to be much more succinct with your code by grouping values. There is no value in the goto statement since the code would go there next anyway
Code:
Sub PrintLetterhead() Dim defprinter As String defprinter = UCase(Mid(ActivePrinter, 1, 20)) Select Case defprinter Case "\\GS-DC2\MFP1", "\\GS-DC2\MFP2", "\\GS-DC2\MFP3", "\\GS-DC2\MFP4", "BOOKKEEPING XEROX WORKCENTRE PRO 5335" With ActiveDocument.PageSetup .FirstPageTray = 260 .OtherPagesTray = 259 End With Case "\\GS-DC2\MFP5", "\\GS-DC2\MFP6" With ActiveDocument.PageSetup .FirstPageTray = wdPrinterMiddleBin .OtherPagesTray = wdPrinterLowerBin End With Case Else With ActiveDocument.PageSetup .FirstPageTray = 258 .OtherPagesTray = 259 End With End Select
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
SMNRyan | Word | 2 | 06-20-2013 01:04 PM |
MS Word 2003, printer queue in 'printer properties' shows 1 job; no job in printer | benhuxham | Word | 0 | 07-25-2011 06:58 PM |
![]() |
pclum | Word | 4 | 07-02-2011 02:36 AM |
![]() |
Nonplussed | Word | 1 | 02-03-2011 03:20 PM |
![]() |
Nathalie Palmer | Word | 3 | 01-06-2011 01:50 AM |