Results 1 to 13 of 13
  1. #1
    3 Star Lounger
    Join Date
    May 2002
    Location
    Melbourne, Australia
    Posts
    269
    Thanks
    32
    Thanked 0 Times in 0 Posts

    Word 2010 printing doesn't follow paper tray selection

    I have set up a letter in Word 2010, with pre-printed letterhead as page 1, a section break next page, then different margins and plain paper on all subsequent pages.

    To print the letter, I have set up a macro, as follows:

    With ActiveDocument.PageSetup
    .FirstPageTray = 256
    .OtherPagesTray = wdPrinterUpperBin
    End With

    ActiveDocument.PrintOut Range:=wdPrintAllDocument

    where paper tray code '256' selects the printed paper in Tray 4 and 'wdPrinterUpperBin' selects plain paper from Tray 1.

    This does NOT work. The first page AND the second page both come out of the 'FirstPageTray' (Tray 4). Subsequent pages then come out on plain paper from the 'OtherPagesTray' (Tray 1).

    If I print the document manually, setting 'Paper' in 'Page Setup' to take the first page from the printed letterhead tray (Tray 4) and all subsequent pages from the plain paper tray (Tray 1), it also does NOT work, printing the first two pages from the printed paper tray, just like the macro.

    I would be very grateful if someone took pity on me (and my few remaining strands of hair not yet pulled out) and tell me how to get this rather simple task to work.

    Regards
    useful

  2. #2
    5 Star Lounger kmurdock's Avatar
    Join Date
    Feb 2003
    Location
    Pacific Grove, California, USA
    Posts
    716
    Thanks
    10
    Thanked 34 Times in 28 Posts
    Do you have Different First Page checked? If so, your Section Break Next Page tells Word that the second page is essentially also a first page (of the next section). If you have Different First Page set, uncheck it, but leave your print instructions the same.

    Does that help?

    Kim

  3. #3
    3 Star Lounger
    Join Date
    May 2002
    Location
    Melbourne, Australia
    Posts
    269
    Thanks
    32
    Thanked 0 Times in 0 Posts
    Hi Kim

    Thank you for your response.

    What you say makes perfect sense. That explains it!

    I have 'Different First Page' set because the first page is a printed letterhead with different margins and header/footer size and the subsequent pages plain with different margins and header/footers.

    When I didn't have it set and just made a second page with a section break next page and set margins, headers and footers in a macro, the third page inexplicably printed from the letterhead paper tray.

    How else can I do this? It seems so simple, but I'm struggling with it.

    Thank you.
    useful

  4. #4
    5 Star Lounger kmurdock's Avatar
    Join Date
    Feb 2003
    Location
    Pacific Grove, California, USA
    Posts
    716
    Thanks
    10
    Thanked 34 Times in 28 Posts
    I see the bottom-line issue here. We can set it up so the second and successive pages are formatted differently, but we still can't tell the "real" second page to print from the other tray because it's still the first page of the second section. And really, printing a file full of merged letters relies on this behavior -- the section break between letters triggers printing the next page from the letterhead tray for the next letter.

    How about this for a workaround? Since your formatting relied on having a next page section break at the bottom of the first page anyway, why not try formatting your first page with a table or set of tables?

    • First, set the margins the same for all the pages.
    • Next, go back to Different First Page.
    • Now, put a table or tables on the first page -- tables can defy margins, so you can use them to do the some footwork.
    • (Styles can defy margins, too, but not knowing what your format is, I don't know if this would be helpful.)
    • Use the vba to print.

    Will this get you where you want to go? What do you think?

    Kim

  5. #5
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,436
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    Useful,

    Try setting up the code necessary for the Letter head and have it just print the 1st page.
    Then change the coding and print the rest of the document pg 2-.
    Should work.

    Code:
    Option Explicit
    
    Sub MultiPagePrint()
    
         Application.PrintOut FileName:="", _
                    Range:=wdPrintRangeOfPages, _
                    Item:=wdPrintDocumentWithMarkup, _
                    Copies:=1, Pages:="1-1", _
                    PageType:=wdPrintAllPages, _
                    Collate:=True, _
                    Background:=True, _
                    PrintToFile:=False
    
        Application.PrintOut FileName:="", _
                   Range:=wdPrintRangeOfPages, _
                   Item:= wdPrintDocumentWithMarkup, _
                   Copies:=1, Pages:="2-", _
                   PageType:=wdPrintAllPages, _
                   Collate:=True, _
                   Background:=True, _
                   PrintToFile:=False
    End Sub
    Just add the appropriate tray selection code to the two sections above.

    HTH
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  6. #6
    5 Star Lounger kmurdock's Avatar
    Join Date
    Feb 2003
    Location
    Pacific Grove, California, USA
    Posts
    716
    Thanks
    10
    Thanked 34 Times in 28 Posts
    Good one, RetiredGeek!

  7. #7
    3 Star Lounger
    Join Date
    May 2002
    Location
    Melbourne, Australia
    Posts
    269
    Thanks
    32
    Thanked 0 Times in 0 Posts
    Hi RetiredGeek

    I'm grateful for your response and the code.

    Unlike Kim, I am unable to actually write VBA, so I'm not sure how or where to put the tray selection code and whether once that code is inserted, whether the print macro will run as you wrote it, or whether you intended that I print page one with the first part, then run the second part as another macro to print page 2 onwards?

    As you can see, I really have no idea.

    Also, Kim correctly pointed out that by using the 'Different First Page' technique, my Section Break Next Page tells Word that the second page is essentially also a first page (of the next section), which is why I am getting letterhead paper for the first two pages. Does your code overcome this?

    I would be extremely grateful if you could send me the required code complete with paper tray selections, so I don't mess it up (the code 256 selects the letterhead paper tray and the code wdPrinterUpperBin selectes the plain paper tray).

    Thank you very much.

    Regards
    useful

  8. #8
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,436
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    Useful,

    Ok, here's what I think will work but I don't have a printer to test it.
    Just running this code should print the whole document.

    Code:
    Option Explicit
    
    Sub MultiPagePrint()
    
    'Note: This code assumes that you do NOT have the
    '      First Page Different option selected!
    
        With ActiveDocument.PageSetup
            .FirstPageTray = 256
            .OtherPagesTray = 256
         End With
    
         Application.PrintOut FileName:="", _
                    Range:=wdPrintRangeOfPages, _
                    Item:=wdPrintDocumentWithMarkup, _
                    Copies:=1, Pages:="1-1", _
                    PageType:=wdPrintAllPages, _
                    Collate:=True, _
                    Background:=True, _
                    PrintToFile:=False
    
        With ActiveDocument.PageSetup
            .FirstPageTray = wdPrinterUpperBin
            .OtherPagesTray = wdPrinterUpperBin
         End With
    
        Application.PrintOut FileName:="", _
                   Range:=wdPrintRangeOfPages, _
                   Item:= wdPrintDocumentWithMarkup, _
                   Copies:=1, Pages:="2-", _
                   PageType:=wdPrintAllPages, _
                   Collate:=True, _
                   Background:=True, _
                   PrintToFile:=False
    End Sub
    HTH
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  9. The Following User Says Thank You to RetiredGeek For This Useful Post:

    useful (2013-08-04)

  10. #9
    3 Star Lounger
    Join Date
    May 2002
    Location
    Melbourne, Australia
    Posts
    269
    Thanks
    32
    Thanked 0 Times in 0 Posts
    Hi RetiredGeek

    Thank you for your prompt response and the code.

    I will try going back to my original technique of not having 'Different First Page' checked and setting up the first page with the letterhead, make a second page with a Section Break Next Page and set different margins, headers and footers in a macro and hopefully your print code will print all pages from the right bins.

    I will have to test this with just the letterhead page and see if that works too.

    I'll post again and let you know.

    Thanks again.

    Regards
    useful

  11. #10
    3 Star Lounger
    Join Date
    Feb 2001
    Location
    Willow Grove, Pennsylvania, USA
    Posts
    205
    Thanks
    4
    Thanked 49 Times in 40 Posts
    Quote Originally Posted by useful View Post
    I will have to test this with just the letterhead page and see if that works too.
    To prevent an error message when the document has only one page, you need to put the cursor in the empty line indicated below

    Code:
                    Background:=True, _
                    PrintToFile:=False
                                                         <== here
        With ActiveDocument.PageSetup
            .FirstPageTray = wdPrinterUpperBin
    and paste in this line:

    Code:
        If ActiveDocument.Range.Information(wdActiveEndPageNumber) < 2 Then Exit Sub

  12. The Following 2 Users Say Thank You to jjfreedman For This Useful Post:

    RetiredGeek (2013-08-04),useful (2013-08-04)

  13. #11
    3 Star Lounger
    Join Date
    May 2002
    Location
    Melbourne, Australia
    Posts
    269
    Thanks
    32
    Thanked 0 Times in 0 Posts
    Thank you very much RetiredGeek and jjfreedman.

    I have tested the code (from RetiredGeek plus the vital addition from jjfreedman) with the appropriate printer and it works like a charm!!

    I'm very grateful to you both for your prompt attention and invaluable help!

    Regards
    useful

  14. #12
    New Lounger
    Join Date
    Aug 2013
    Posts
    1
    Thanks
    0
    Thanked 1 Time in 1 Post
    Hi we had a very similar problem at our legal office and we've found a bit of commercial sofware called Tray Selector that solves this. It allows you to configure single click buttons in the Word 2010 ribbon bar (it its own tab) which once clicked output your print job to a particular printer or printer tray combination. You can setup lots of these buttons one for headed paper one for plain etc. The site is http://us.trayselector.com. The product allows you to promt the user for a page range and number of copies. We found this a lot more reliable than trying to write our own macros which often failed when we deployed new printers etc.

    I hope that helps.

  15. The Following User Says Thank You to bigdave99 For This Useful Post:

    useful (2013-08-22)

  16. #13
    3 Star Lounger
    Join Date
    May 2002
    Location
    Melbourne, Australia
    Posts
    269
    Thanks
    32
    Thanked 0 Times in 0 Posts
    Thanks for the response bigdave99.

    As you can see from the previous post, I have now set up a macro to do the printing, but this commercial software looks great! If I get stuck again, I will certainly give it a shot.

    Thanks again.

    Regards
    useful

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •