Hi
I've recently upgraded my PC from Windows 98 to XP Pro. I have a whole bunch of macros/templates that deal with my file creation and these continue to work fine when transferred to XP.
However, the problem is with my printing macros. They worked fine on Windows 98 but since moving, XP appears to just ignore all of the Word paper tray commands (wdPrinterUpperBin, etc) and everything prints from the default tray. I'm still using Word 2000 and the printer is a HP4100TN.
Have things changed on XP? Anyone have any pointers, things to try? Below is the code.
Tolan
=-=-=-=
Private Sub Cmdprint_Click()
Application.PrintOut FileName:="", Range:=wdPrintAllDocument
' This is the default printer trays for the kyocera printers
strLetterhead = wdPrinterUpperBin
strNormalPaper = wdPrinterMiddleBin
' If it's not a kyocera printer you have to tell it to use
' other trays
If InStr(ActivePrinter, "Printer HP 1") <> 0 Then
strLetterhead = wdPrinterUpperBin
strNormalPaper = wdPrinterLargeCapacityBin
End If
If InStr(ActivePrinter, "Printer Kyocera 2") <> 0 Then
strLetterhead = wdPrinterUpperBin
strNormalPaper = wdPrinterLargeCapacityBin
End If
Select Case strPrintChoice
'Letterhead
Case "L"
'Sort Paper
With ActiveDocument.PageSetup
.FirstPageTray = strLetterhead
.OtherPagesTray = strNormalPaper
End With
'Print
Application.PrintOut FileName:="", Range:=wdPrintAllDocument
'Sort Paper
With ActiveDocument.PageSetup
.FirstPageTray = strNormalPaper
.OtherPagesTray = strNormalPaper
End With
'Letter and File Copy
Case "F"
'Sort Paper
With ActiveDocument.PageSetup
.FirstPageTray = strLetterhead
.OtherPagesTray = strNormalPaper
End With
'Print
Application.PrintOut FileName:="", Range:=wdPrintAllDocument
'Sort Paper
With ActiveDocument.PageSetup
.FirstPageTray = strNormalPaper
.OtherPagesTray = strNormalPaper
End With
'Print
Application.PrintOut FileName:="", Range:=wdPrintAllDocument
End Select
Unload Me
End Sub
I've recently upgraded my PC from Windows 98 to XP Pro. I have a whole bunch of macros/templates that deal with my file creation and these continue to work fine when transferred to XP.
However, the problem is with my printing macros. They worked fine on Windows 98 but since moving, XP appears to just ignore all of the Word paper tray commands (wdPrinterUpperBin, etc) and everything prints from the default tray. I'm still using Word 2000 and the printer is a HP4100TN.
Have things changed on XP? Anyone have any pointers, things to try? Below is the code.
Tolan
=-=-=-=
Private Sub Cmdprint_Click()
Application.PrintOut FileName:="", Range:=wdPrintAllDocument
' This is the default printer trays for the kyocera printers
strLetterhead = wdPrinterUpperBin
strNormalPaper = wdPrinterMiddleBin
' If it's not a kyocera printer you have to tell it to use
' other trays
If InStr(ActivePrinter, "Printer HP 1") <> 0 Then
strLetterhead = wdPrinterUpperBin
strNormalPaper = wdPrinterLargeCapacityBin
End If
If InStr(ActivePrinter, "Printer Kyocera 2") <> 0 Then
strLetterhead = wdPrinterUpperBin
strNormalPaper = wdPrinterLargeCapacityBin
End If
Select Case strPrintChoice
'Letterhead
Case "L"
'Sort Paper
With ActiveDocument.PageSetup
.FirstPageTray = strLetterhead
.OtherPagesTray = strNormalPaper
End With
Application.PrintOut FileName:="", Range:=wdPrintAllDocument
'Sort Paper
With ActiveDocument.PageSetup
.FirstPageTray = strNormalPaper
.OtherPagesTray = strNormalPaper
End With
'Letter and File Copy
Case "F"
'Sort Paper
With ActiveDocument.PageSetup
.FirstPageTray = strLetterhead
.OtherPagesTray = strNormalPaper
End With
Application.PrintOut FileName:="", Range:=wdPrintAllDocument
'Sort Paper
With ActiveDocument.PageSetup
.FirstPageTray = strNormalPaper
.OtherPagesTray = strNormalPaper
End With
Application.PrintOut FileName:="", Range:=wdPrintAllDocument
End Select
Unload Me
End Sub