Select paper tray using VBScripting

S

stan

Is it possible to tell the output from my vbscript which paper tray to
print on? I need to print to the lower tray (tray 3) of our HP 8150
and really would like to accomplish this through my script. Is this
possible through any type of vb object?

Thanks,
Stan
 
D

Doug Robbins - Word MVP

See the following articles by fellow MVP Jonathon West

Controlling the Printer from Word VBA
Part 1: Using VBA to Select the Paper Tray
http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=101

Controlling the Printer from Word VBA
Part 2: Using VBA to control Duplex, Color Mode and Print Quality
http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=116

Controlling the Printer from Word VBA
Part 3: Dealing with Different Paper Sizes
http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=132

Controlling the Printer from Word VBA
Part 4: Getting printer driver details
http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=183


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
S

stan

I'm not using Word VBA. I've written a stand alone VBScript that I'm
wanting to accomplish this with.

Thanks,
Stan
 
J

Jonathan West

stan said:
I'm not using Word VBA. I've written a stand alone VBScript that I'm
wanting to accomplish this with.

I very much doubt that VBScript has enough of a feature set to be able to
achieve this.

But let me ask - what are you trying to print? Are you controlling Word from
the VBScript in order to do the printing?
 
S

stan

I'm controlling Business Objects through my VBScript and am able to get
the report to print but I need to tell the report which tray to print
out on.

Thanks,
Stan
 
J

Jonathan West

stan said:
I'm controlling Business Objects through my VBScript and am able to get
the report to print but I need to tell the report which tray to print
out on.

Is the report a Word document?

Do you know what printer it will be printed on?

Do you know the Tray ID for the tray you want to use on that printer?

If the answer to all these questions is "Yes", then you can proceed as
follows

1. Make sure that the ActivePrinter property is set to the correct printer

2. Set the FirstPageTray and OtherPagesTray properties of the document to
the tray

3. Print the document using the Printout method.

All these things can be done by VBScript controlling the Word object model.
 
D

Doug Robbins - Word MVP

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top