Macro overriding Xerox settings

M

Mable

Hello all,

I've been developing a macro to print out documents to
seperate trays of a printer, based upon the contents of
each page. I've come up with a solution that works when
tested upon my HP LaserJet 4500. However, the people I
have been constructing this macro for require it to be
used on a Xerox Docuprint machine. The Xerox machine has
its own software which specifies how each job is printed
based upon the computer from which it is sent.

Does anyone know how it would be possible for my macro to
override the Xerox's settings? I've included the macro's
code.

Sub SortPrintTrays()

'Gets page count
Dim intPages As Integer
intPages = ActiveDocument.BuiltInDocumentProperties
(wdPropertyPages)

'Creates placeholder for White characters
Dim s As String

'Custom Function, clears any previous search settings
Resetsearch

'Creates variable for the entire document
Dim oRng As Range
Documents("Document1").Activate
Set oRng = ActiveDocument.Range

'Sorting FOR Loop, finds each White character and prints
page accordingly

For Sort = 1 To intPages

With oRng.Find
.ClearFormatting
.Font.Color = wdColorBlack
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False

oRng.Find.Execute
s = oRng.Text
ActiveDocument.Bookmarks("\Page").Select
oRng.Collapse direction:=wdCollapseEnd
oRng.Select
If s = 1 Then
Options.DefaultTrayID = 256 ' Tray 1

ActiveDocument.PrintOut Range:=wdPrintCurrentPage
Else
Options.DefaultTrayID = 258 ' Tray 2

ActiveDocument.PrintOut Range:=wdPrintCurrentPage
End If
oRng.End = ActiveDocument.Range.End
End With

Next Sort

End Sub
 
J

Jonathan West

Hi Mable

Instead of setting the DefaultTrayID, you might try setting the
FirstPageTray &/or OtherPagesTray properties of the PageSetup object. These
override the DefaultTrayID property when set and might override the Xerox
settings.
 
M

Mable

I tried changing the trayID sections to UpperBin and
LowerBin (they were coded in properly I'm just using
shorthand for conversation's sake) and unfortunately, the
Xerox still processed them onto the same tray as per its
software's instructions.

Any other ideas?
 

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