M
mike.dicanio
Hi,
I am frustrated. I keep getting the error Run-time error '4608' Valule
out of Range.
Here are the details. This error only occurs in a specific Word 2003
document. It happens when I click either one of two buttons on my toolbar
that are linked to a macro that sends the document to either the upper or
lower printer tray. Here is the VBA code for the macro:
Option Explicit
------------------------------------------
Sub UpperTray()
Dim OriginalFirstPageSetting As Long
Dim OriginalOtherPagesSetting As Long
Dim FirstPageTray As Long
Dim OtherPagesTray As Long
Dim wdPrinterMiddleBin As Long
With ActiveDocument.PageSetup
OriginalFirstPageSetting = .FirstPageTray
OriginalOtherPagesSetting = .OtherPagesTray
.FirstPageTray = wdPrinterMiddleBin
.OtherPagesTray = wdPrinterMiddleBin
ActiveDocument.PrintOut
.FirstPageTray = OriginalFirstPageSetting
.OtherPagesTray = OriginalOtherPagesSetting
End With
End Sub
---------------------------------------------------
Sub LowerTray()
Dim OriginalFirstPageSetting As Long
Dim OriginalOtherPagesSetting As Long
Dim FirstPageTray As Long
Dim OtherPagesTray As Long
With ActiveDocument.PageSetup
OriginalFirstPageSetting = .FirstPageTray
OriginalOtherPagesSetting = .OtherPagesTray
.FirstPageTray = wdPrinterLowerBin
.OtherPagesTray = wdPrinterLowerBin
ActiveDocument.PrintOut
.FirstPageTray = OriginalFirstPageSetting
.OtherPagesTray = OriginalOtherPagesSetting
End With
End Sub
Can anyone help?
Thanks.
I am frustrated. I keep getting the error Run-time error '4608' Valule
out of Range.
Here are the details. This error only occurs in a specific Word 2003
document. It happens when I click either one of two buttons on my toolbar
that are linked to a macro that sends the document to either the upper or
lower printer tray. Here is the VBA code for the macro:
Option Explicit
------------------------------------------
Sub UpperTray()
Dim OriginalFirstPageSetting As Long
Dim OriginalOtherPagesSetting As Long
Dim FirstPageTray As Long
Dim OtherPagesTray As Long
Dim wdPrinterMiddleBin As Long
With ActiveDocument.PageSetup
OriginalFirstPageSetting = .FirstPageTray
OriginalOtherPagesSetting = .OtherPagesTray
.FirstPageTray = wdPrinterMiddleBin
.OtherPagesTray = wdPrinterMiddleBin
ActiveDocument.PrintOut
.FirstPageTray = OriginalFirstPageSetting
.OtherPagesTray = OriginalOtherPagesSetting
End With
End Sub
---------------------------------------------------
Sub LowerTray()
Dim OriginalFirstPageSetting As Long
Dim OriginalOtherPagesSetting As Long
Dim FirstPageTray As Long
Dim OtherPagesTray As Long
With ActiveDocument.PageSetup
OriginalFirstPageSetting = .FirstPageTray
OriginalOtherPagesSetting = .OtherPagesTray
.FirstPageTray = wdPrinterLowerBin
.OtherPagesTray = wdPrinterLowerBin
ActiveDocument.PrintOut
.FirstPageTray = OriginalFirstPageSetting
.OtherPagesTray = OriginalOtherPagesSetting
End With
End Sub
Can anyone help?
Thanks.