Re: get Paper Tray
From: zSplash (zNOSPAMSplash_at_)
Date: 04/27/04
- Next message: Larry: "Re: Code Cleaner deleting keystroke assignments"
- Previous message: Kevin R: "Create Custom Menu with VBA"
- In reply to: Jonathan West: "Re: get Paper Tray"
- Next in thread: zSplash: "Re: get Paper Tray"
- Reply: zSplash: "Re: get Paper Tray"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 27 Apr 2004 14:02:16 -0800
Thanks so much, Jonathan. You were exactly right -- the driver was not
installed locally.
I have "discovered" the trayID's for one of the 5 printers involved. Seems
sorta goofy, that I would have to locally install the drivers for all of
these printers, and then get the trayID for each bin I need, and then write
code to react to whatever printer is selected. But, this whole thing seems
sorta hokey. Thanks so much for your good code and excellent advice.
st.
"Jonathan West" <jwest@mvps.org> wrote in message
news:OOQFNuFLEHA.4032@TK2MSFTNGP10.phx.gbl...
> Is the printer connected via a network? If so, do you have a locally
> installed copy of the printer driver?
>
> if you do not have a local copy of the driver, install one and try again.
>
> --
> Regards
> Jonathan West - Word MVP
> http://www.multilinker.com
> Please reply to the newsgroup
>
> "zSplash" <zNOSPAMSplash@ gci.net> wrote in message
> news:eYR$Jw9KEHA.1000@TK2MSFTNGP11.phx.gbl...
> > Thanks, Jonathan. So, I did as suggested in your article, and even
though
> I
> > know there are at least 3 paper trays (the multi-purpose tray, the top
> tray,
> > and the bottom tray -- or WHATEVER they're called), the code comes back
> with
> > only one iBinArray(0), and only one choice, "FormSelect". Then, when I
> > select that one option, I get the error:
> > "Run-time error 4608: Value out of range"
> > and when I check the code, it's stopped on
> > ActiveDocument.PageSetup.OtherPagesTray = _
> > vBinNumbers(ListBox1.ListIndex)
> > and if I "hover" I see that the statement = False.
> >
> > Can you make any sense of this?
> > st.
> >
> > "Jonathan West" <jwest@mvps.org> wrote in message
> > news:uz8OP7UKEHA.1156@TK2MSFTNGP09.phx.gbl...
> > > Hi zSplash,
> > >
> > > The general approach is sound.
> > >
> > > There is a big problem with using the Word constants for this.
Different
> > > printer drivers use different values for the various printer trays,
and
> > they
> > > almost never match the values of the Word constants. Therefore, you
need
> > to
> > > find you what tray ID codes are used for your specific printer, and
use
> > > those in place of the Word constants. This article tells you how.
> > >
> > > Controlling the Printer from Word VBA
> > > Part 1: Using VBA to Select the Paper Tray
> > > http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=101
> > >
> > > --
> > > Regards
> > > Jonathan West - Word MVP
> > > http://www.multilinker.com
> > > Please reply to the newsgroup
> > >
> > > "zSplash" <zNOSPAMSplash@ gci.net> wrote in message
> > > news:u6jTraLKEHA.2244@tk2msftngp13.phx.gbl...
> > > > I have created a custom document property ("Tray") to value "green"
if
> I
> > > > want my document to print on green paper. I have white paper in my
> top
> > > tray
> > > > (wdPrinterLowerBin), and green paper in my lower tray
> > (wdPrinterUpperBin).
> > > > So, whenever printing, the code checks for the value of "Tray":
> > > > If ActiveDocument.CustomDocumentProperties("Tray").Value =
"green"
> > > Then
> > > > With ActiveDocument.PageSetup
> > > > .FirstPageTray = wdPrinterUpperBin
> > > > .OtherPagesTray = wdPrinterUpperBin
> > > > End With
> > > > Else
> > > > With ActiveDocument.PageSetup
> > > > .FirstPageTray = wdPrinterLowerBin
> > > > .OtherPagesTray = wdPrinterLowerBin
> > > > End With
> > > > End If
> > > >
> > > > Is this reasonable, or is there a better way to do what I'm
attempting
> > to
> > > > do?
> > > >
> > > > TIA, guys.
> > > >
> > > >
> > >
> >
> >
>
- Next message: Larry: "Re: Code Cleaner deleting keystroke assignments"
- Previous message: Kevin R: "Create Custom Menu with VBA"
- In reply to: Jonathan West: "Re: get Paper Tray"
- Next in thread: zSplash: "Re: get Paper Tray"
- Reply: zSplash: "Re: get Paper Tray"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|