• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1529
  • Last Modified:

VBA Word 2000: Print to multiple trays...

Hi.

I have a LaserJet 4300 Printer with 4 Trays.
Tray 1 (Manual feed), Tray 2(Letterhead), Tray 3(Yellow/Color), Tray 4 (Plain)

I created a form where a user can choose to which tray they print to.

The code on the form is below:
_____________________________
Option Explicit

Private Sub cmdClose_Click()
frmUSer.Hide
End Sub

' Tray 1 - 264
' Tray 1 (Manual Feed) - 258
' Tray 2 (Letterhead) - 263
' Tray 3 (Colour) - 262
' Tray 4 (Plain) - 259

Private Sub OptionButton1_Click() 'Print 1st page to Letterhead Paper and following pages to plain
 With Selection.PageSetup
        .FirstPageTray = 263
        .OtherPagesTray = 259
    End With
End Sub

Private Sub OptionButton2_Click() 'Print all Pages to Colour Paper
    With Selection.PageSetup
        .FirstPageTray = 262
        .OtherPagesTray = 262
    End With
End Sub


Private Sub OptionButton3_Click() 'Print all pages to Plain Paper
    With Selection.PageSetup
        .FirstPageTray = 259
        .OtherPagesTray = 259
    End With
End Sub

Private Sub cmdPrint_Click() ' Print 1 copy to Letterhead (tray 2) + 1 copy to yellow paper (tray 3)
   If OptionButton4 = True Then
       OptionButton1_Click
       Application.PrintOut
       OptionButton2_Click
       Application.PrintOut
    Else
        Application.PrintOut
    End If
    Unload frmUSer

End Sub
_____________________________

All options work, except for the last one (optionbutton4, which prints a copy of the document to the letterhead tray and another to the colour tray).

This option is crashing Word 2000. When I check the print queue there are 2 jobs. The first one says its printing but nothing happens.

Is there something wrong with my code? Any suggestions on how I could fix this?

Thanks
Priscilla
0
Priscilla_Hora
Asked:
Priscilla_Hora
1 Solution
 
Priscilla_HoraAuthor Commented:
I think I may have found a fix to this problem.
I have turned background printing off within word.. and guess what! It all works!!
0
 
GrahamSkanCommented:
Well done. Ask for a points refund in the Community Support area.
0
 
CetusMODCommented:
Question PAQ'd
300 points refunded.

CetusMOD
Community Support Moderator
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now