Share via

Run-time Error 4608 Value out of Range

Anonymous
2015-08-31T23:58:39+00:00

I am creating a macro on the same machine with the same document and the same printer definition.

Simply trying to print one copy of the doc using upper tray, 2nd and 3rd copies of the doc on middle tray.  Runtime error 4608 out of range on bold line below:

Sub print2copies()

Selection.WholeStory

'green copy

ActiveDocument.PageSetup.FirstPageTray = wdPrinterUpperBin      'runtime error 4608 value out of range

ActiveDocument.PageSetup.OtherPagesTray = wdPrinterUpperBin

Application.PrintOut FileName:="", Range:=wdPrintAllDocument, Item:= _

wdPrintDocumentWithMarkup, Copies:=1, Pages:="", PageType:= _

wdPrintAllPages, Collate:=True, Background:=True, PrintToFile:=False, _

PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _

PrintZoomPaperHeight:=0

'white copy

ActiveDocument.PageSetup.FirstPageTray = wdPrinterMiddleBin

ActiveDocument.PageSetup.OtherPagesTray = wdPrinterMiddleBin

Application.PrintOut FileName:="", Range:=wdPrintAllDocument, Item:= _

wdPrintDocumentWithMarkup, Copies:=1, Pages:="", PageType:= _

wdPrintAllPages, Collate:=True, Background:=True, PrintToFile:=False, _

PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _

PrintZoomPaperHeight:=0

When I record the macro, it gives me this, and still errors 4608 as soon as it starts running the bold line below...

With ActiveDocument.Styles(wdStyleNormal).Font

If .NameFarEast = .NameAscii Then

.NameAscii = ""

End If

.NameFarEast = ""

End With

With ActiveDocument.PageSetup

       .LineNumbering.Active = False               'error 4608 out of range here

.Orientation = wdOrientPortrait

.TopMargin = InchesToPoints(0.5)

.BottomMargin = InchesToPoints(0.5)

.LeftMargin = InchesToPoints(0.75)

.RightMargin = InchesToPoints(0.75)

.Gutter = InchesToPoints(0)

.HeaderDistance = InchesToPoints(0.44)

.FooterDistance = InchesToPoints(0.5)

.PageWidth = InchesToPoints(8.5)

.PageHeight = InchesToPoints(11)

      .FirstPageTray = wdPrinterUpperBin

.OtherPagesTray = wdPrinterUpperBin

.OddAndEvenPagesHeaderFooter = False

.DifferentFirstPageHeaderFooter = True

.VerticalAlignment = wdAlignVerticalTop

.SuppressEndnotes = False

.MirrorMargins = False

.TwoPagesOnOne = False

.BookFoldPrinting = False

.BookFoldRevPrinting = False

.BookFoldPrintingSheets = 1

.GutterPos = wdGutterPosLeft

End With

Microsoft 365 and Office | Word | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2016-09-23T09:40:37+00:00

Check first of all whether your document contains sections. If so, the code may need some adaptations to handle each section separately. Remove the section breaks, and you may be up and running again.

Was this answer helpful?

20+ people found this answer helpful.
0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Jay Freedman 207.7K Reputation points Volunteer Moderator
    2015-09-08T21:50:35+00:00

    Both of the indicated lines are legal syntax and the values being assigned are valid. There shouldn't be any errors in either place.

    Follow the troubleshooting procedures in http://support.microsoft.com/kb/921541. First try the Fixit button, and then test your macro. If it still errors, use the manual procedures -- EXCEPT put the "Delete the Word Data registry subkey" and "Delete the Word Options registry subkey" sections at the end instead of the beginning. That is, try renaming the Normal.dotm template first, and test the macro; if it still errors, disable any add-ins and test again. Leave the registry work for last, both because it's the least likely cause and because it's the most time-consuming.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2015-09-08T17:55:50+00:00

    No help yet, and Microsoft's automated service is asking me to post a request for more help...Thank you!

    Was this answer helpful?

    0 comments No comments