|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
documents print setup defined in page setup, but overriden by printer settings. macro required?
I am using Office 2010 and my documents have a combination of paper types (letterhead, follow-on and blank), defined by using a combination of the PageSetup dialog box in Page Layout (see attached) and Section breaks.
Our office is upgrading to Office 2019 and now the printer settings on our photocopier over-rides all these settings. A macro might work, except my attempts so far are either for current page to a particular printer tray, or Page 1 to Tray X and Page 2 onwards to Tray Y. It seems the only way I can print my letters will be to divide them into separate documents. I'm open to any suggestions! I'm desperate to find a solution before my upgrade. Thank you! |
#2
|
||||
|
||||
Print to a specific printer explains how to print to separate trays using a macro and how to establish the tray numbers.
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#3
|
|||
|
|||
@gmayor - thank you. I have located the printer tray numbers - it is more that my document may have (and of course not every letter follows the same pattern...
eg page 1: letterhead, page 2 follow-on (MP tray), //Section Break // page 3: letterhead, page 4: letterhead, page 5: letterhead //Section Break // page 6: blank, page 7: blank //Section Break // page 8: letterhead, page 9 onwards: blank my limited knowledge of macros does not extend to working around this! |
#4
|
||||
|
||||
Bearing in mind that I don't have access to your printer to check it, the following should work. As I indicated in my web page some printers don't respond to calling the trays by name and require the tray IDs as described on the web page.
In which case Options.DefaultTray would have to be Options.DefaultTrayID and the two IDs would replace the values sLetterhead and sPlain. I have turned off background printing as this is presumably a shared printer Code:
Sub PrintToTrays() Dim sCurrentPrinter As String Dim sTray As Long Const sLetterhead As String = "Drawer 3" Const sPlain As String = "Multi-purpose Tray" With Dialogs(wdDialogFilePrintSetup) Options.DefaultTray = sLetterhead PrintIt "1" Options.DefaultTray = sPlain PrintIt "2" Options.DefaultTray = sLetterhead PrintIt "3-5" Options.DefaultTray = sPlain PrintIt "6-7" Options.DefaultTray = sLetterhead PrintIt "8" Options.DefaultTray = sPlain PrintIt "9-999" .Execute End With End Sub Sub PrintIt(sPrintRange As String) Application.PrintOut FileName:="", _ Range:=wdPrintRangeOfPages, _ Item:=wdPrintDocumentWithMarkup, _ copies:=1, _ Pages:=sPrintRange, _ PageType:=wdPrintAllPages, _ collate:=True, _ Background:=True, _ PrintToFile:=False, _ PrintZoomColumn:=0, _ PrintZoomRow:=0, _ PrintZoomPaperWidth:=0, _ PrintZoomPaperHeight:=0 End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#5
|
|||
|
|||
@gmayor
please forgive my ignorance. Does this macro example mean you have specified the tray selection for every page (as per my example)? so eg "3-5" means pages 3-5? This is exceptionally helpful, and I am very appreciative of you writing this code. My problem is that not every letter follows that structure. It is intensively variable, so that macro would not be universal - if I've understood correctly. Please correct me if I've misunderstood. I'm trying to learn as I go. (yes - my trays are called:- Plain: PrinterUpperBin, Letterhead 1: PrinterLowerBin, Letterhead 2: 264 and MP tray (follow-on): PrinterManualFeed) |
#6
|
||||
|
||||
The macro would not be universal. It would have to be modified for each document, or you could drive it from a more user friendly dialog, but that would be beyond your skill set, given your comments, and beyond the scope of this forum. If you want to discuss that further contact me via my web site.
The code I posted is relatively simple. Basically it uses the PrintIt macro to create a print job, when supplied with page numbers from the main macro PrintToTrays. The trays are defined as the variables (here two trays defined, changed to reflect your comments, but you can add others) Code:
Const sLetterhead As String = "PrinterLowerBin" Const sPlain As String = "PrinterUpperBin"
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#7
|
|||
|
|||
@gmayor
yes, that all makes sense - and damn Microsoft for allowing printer properties to over-ride Print Dialog settings. Thank you for clarifying and understanding that yes, I am very much a beginner (and quite out of my depth on this one!!) At least this gives me some sort of starting point to work with, for which I am very grateful. Thank you! |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Cant find Page setup for printer excel android | NeverTheLess | Excel | 0 | 10-19-2016 07:24 AM |
Priview/Print Setup for Project | Rahmat_uk20 | Project | 3 | 08-07-2012 03:05 AM |
Page Setup | gus | PowerPoint | 0 | 03-09-2010 09:51 PM |
print setup | alkey | Excel | 1 | 02-09-2007 06:47 AM |
Page Setup | Ryan | Word | 0 | 01-24-2007 10:42 AM |