Re: get Paper Tray
From: zSplash (zNOSPAMSplash_at_)
Date: 04/28/04
- Next message: JethroUK©: "Lock Toolbars down"
- Previous message: MLulofs: "Return word counts of multiple Word docs?"
- In reply to: zSplash: "Re: get Paper Tray"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 28 Apr 2004 08:29:25 -0800
I plea for help yet again...
So, when I run my code using the locally installed driver (for which I have
obtained the proper trayID's), everything's fine. When I switch to the
networked printer, however, evidently the trayID's are "wrong", since the
code does not work. (I.e., my code points to bin 263 and 264 locally, which
prints color and white respectively. When using the network printer, the
exact same code to the exact same printer, but using the network (not the
local driver), the code results in inappropriate output.
Somehow, my reasoning thought if I "got" the trayID's, and then referred to
them in my code, the network printers would "recognize" the same trayID. Is
that faulty reasoning? Is there any reason the driver should not be
installed on the server??? (I am obviously not a network administrator!!)
What do you think the deal is?
st.
"zSplash" <zNOSPAMSplash@ gci.net> wrote in message
news:%23Ev1ONKLEHA.2260@TK2MSFTNGP09.phx.gbl...
> 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: JethroUK©: "Lock Toolbars down"
- Previous message: MLulofs: "Return word counts of multiple Word docs?"
- In reply to: zSplash: "Re: get Paper Tray"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|