#1
|
|||
|
|||
Error 4120 when using a printing macro
I use a macro to print several multi page documents. My printer will not do what I want it to do so my macro prints the document one page at a time: Here is a bit of the code;
Selection.GoTo What:=wdGoToPage, Which:=1 The print routine Selection.GoTo What:=wdGoToPage, Which:=2 The print routine Selection.GoTo What:=wdGoToPage, Which:=3 The print routine Selection.GoTo What:=wdGoToPage, Which:=4 ==== The error occurs I get an error 4120 Bad Prameter All of these documents are over 30 pages long so there is a page 4. I have used a counting loop for the “Which:=” number but is still throws the error when the value = 4. Any Help?? |
#2
|
||||
|
||||
No sure what your 'print routine' does but maybe if you use a counting loop (on the x) within this code you could get the job done:
Code:
Selection.GoTo What:=wdGoToPage, Which:=wdGoToAbsolute, Count:=x |
#3
|
|||
|
|||
I will try this presently I have a loop:
Do Until NextPage > TotalPages Selection.GoTo What:=wdGoToPage, Which:=NextPage Print Routine Loop However, your code: Selection.GoTo What:=wdGoToPage, Which:=wdGoToAbsolute, Count:=x Looks like a good idea. Thanks for the response much appreciated. |
#4
|
|||
|
|||
It worked
Yep! it worked. Once again thanks.
|
#5
|
||||
|
||||
Thanks for the feedback, glad having been of some help.
|
Tags |
error 4120 when pprinting |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Word template with Macro keeps getting an error ''Run-time error 5941'' | Marcel | Word VBA | 3 | 12-17-2019 04:55 PM |
Insufficient memory error when printing to a macro | Rockystock | Word VBA | 8 | 10-21-2016 07:43 AM |
Runtime Error 4120 in Word 2007 macro | Frankwlc | Word | 5 | 11-28-2011 01:54 AM |
Error in printing | callkalpa | Word | 0 | 09-21-2010 07:35 PM |
Error message when printing e-mails | nolson | Outlook | 0 | 01-02-2006 09:50 AM |