Printer tray selection...again....

A

Al & Cay Grant

Hi All,

I tried to make a macro to select a printer tray on our
MFD konica copier/printer at work which has 4 trays.

I recorded:

Sub Macro2()

'

' Macro2 Macro

' Macro recorded 17 September 2003 by AGG530

'

Selection.TypeText Text:="TEST BOTTOM TRAY'"

Selection.TypeParagraph

Selection.TypeBackspace

Selection.TypeBackspace

Selection.TypeParagraph

Selection.TypeParagraph

With Options

..UpdateFieldsAtPrint = False

..UpdateLinksAtPrint = False

..DefaultTray = "Tray 4"

..PrintBackground = False

..PrintProperties = False

..PrintFieldCodes = False

..PrintComments = False

..PrintHiddenText = False

..PrintDrawingObjects = True

..PrintDraft = False

..PrintReverse = False

..MapPaperSize = True

End With

With ActiveDocument

..PrintPostScriptOverText = False

..PrintFormsData = False

End With

Application.PrintOut FileName:="", Range:=wdPrintAllDocument, Item:= _

wdPrintDocumentContent, Copies:=1, Pages:="", PageType:=wdPrintAllPages, _

Collate:=True, Background:=False, PrintToFile:=False

End Sub





This code works and I have run it a few times, it correctly prints from tray
4.



I inserted the code into my project and it does'nt work in my project. I
copied

everything using the clipboard except the sub and end sub.



I did msgbox options.defaulttray gives "tray 4"



So what am I doing wrong?



Cheers



- AL
 
M

mksmith

Does it fail on the same machine or on a different machine?

What I do to get the tray code number is to open up the recorder and then
go into the Page Setup and then get the values from there.

If I am handing the code about the firm I make sure that everyone has the
same printer driver on their machines. Perhaps this could be the
problem?

Malc
www.dragondrop.com
 
A

Al & Cay Grant

The code I posted was from recorder!!

What to you mean code number? With recorder I got
With Options
.DefaultTray = "Tray 4"

Which seems obvious?

It would seem their are about three ways to pick the tray in Word;

File+Page Setup+Paper Source
File+Print+Properties (through printer driver)
File+Print+Options+Default Tray

Which is best?

Since the code I record works on its own, I wonder if their is'nt something
in my project that is changing the way the recorded code works?

Cheers

-Al
 
A

Al & Cay Grant

Oh and I looked at the code on the mvps site. It talks about the
available options poping up when you type in the code.

This happens, and has upper/lower bins, manual feeds, etc
but does not talk about a 3rd or 4th bin!!

-AL
 
M

mksmith

File+Page Setup+Paper Source
File+Print+Properties (through printer driver)
File+Print+Options+Default Tray

Which is best?

I record the File + Page Setup + Paper Source and then make sure that each
person uses the same version of the same printer driver.

Then I am assured that it works.

Malc
 
J

Jonathan West

Hi Al,

I've written a series of articles on printer control in Word. The first of
these goes into the issue of paper trays in quite a lot of detail, including
the questions you have asked. I think it might help you in your quest.

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
MultiLinker - Automated generation of hyperlinks in Word
Conversion to PDF & HTML
http://www.multilinker.com
 

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