Word 2000, Multi-Section Document, Error Assigning Value to Paper Tray 
Author Message
 Word 2000, Multi-Section Document, Error Assigning Value to Paper Tray

To accommodate an HP 4000 TN printer having multiple paper
trays, my VBA code seeks to assign different values to the
PageSetup.FirstPageTray and PageSetup.OtherPagesTray
properties depending on whether letterhead or plain paper
is required when printing the document.  The code works
fine, except, strangely, in certain multi-section
documents, where I get a "value out of range" error.  I
know the value is NOT out of range, because I am trying to
assign a value of 11 to .FirstPageTray
and .OtherPagesTray, which are both long variables and
which sometimes are set by Word to the value 11 as an
initial state.

Can anyone help?



Sun, 25 Sep 2005 22:29:26 GMT  
 Word 2000, Multi-Section Document, Error Assigning Value to Paper Tray
Hi George,

Unfortunately, you don't show us a full code line that's
causing the problem, but...

If you're using ActiveDocument.PageSetup try, instead,
looping through all the sections and use section.PageSetup.

Quote:
> To accommodate an HP 4000 TN printer having multiple paper
> trays, my VBA code seeks to assign different values to the
> PageSetup.FirstPageTray and PageSetup.OtherPagesTray
> properties depending on whether letterhead or plain paper
> is required when printing the document.  The code works
> fine, except, strangely, in certain multi-section
> documents, where I get a "value out of range" error.  I
> know the value is NOT out of range, because I am trying to
> assign a value of 11 to .FirstPageTray
> and .OtherPagesTray, which are both long variables and
> which sometimes are set by Word to the value 11 as an
> initial state.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jan
24 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow
question or reply in the newsgroup and not by e-mail :-)



Mon, 26 Sep 2005 23:36:30 GMT  
 Word 2000, Multi-Section Document, Error Assigning Value to Paper Tray
I have a vague recollection of a simialr problem.  If I recall, the issue
was that printer properties could not be assigned if they were specific to a
type of driver that was not installed or currently selected on the
development machine.

You may need to install the drivers for the target printer on the
development machine and / or prevent the code from attempting to set the
properties until it has confirmed the printer type is the same as the target
printer.



Wed, 19 Oct 2005 04:04:17 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Help dividing a multi-word DB field with changing word lengths into sections

2. URGENT: Error when assigning long strings to Form Fields in a protected Word document

3. Mailmerge document restored to normal document (Word 2000)

4. (Q211727) Mail merge document restored to normal document - Word 2000

5. Outlook 2000 to Word 2000 document merge problem

6. Word 2000 vba and custom paper size

7. saving Word 2000 document as Word 97 format

8. Page and Section Breaks in Word 2000

9. Referencing Access 2000 Field Names and Values in Word 2000

10. use paper-type-names instead of paper-tray-names for printing

11. Choosing the printer tray in VBA / Word 2000?

12. Word 2000 from within VB: Windows 2000: error, Windows ME: ok

 

 
Powered by phpBB® Forum Software