Link to home
Start Free TrialLog in
Avatar of shantelechy
shantelechyFlag for Canada

asked on

Disfunctional Macro to Print to Xerox

Hi there, the following macro was designed to tell the Xerox Workcenter Pro 55 to print 2x one white (tray 3) and one pink (tray 2). It doesn't function and I've had no luck finding Xerox documentation by which I could confirm the Tray Codes used in the Macro.

The lawyers here NEED this to work, and Xerox and our in house programmers have not got it happenin'!

The Macro Below has 2 relevant subs the only difference being the lines...

.FirstPageTray = 258
.OtherPagesTray = 258

(or 260 as in the second sub)

________________________________________

Public Sub MAIN()
 
  Pink
 
  White
 
End Sub
Sub Pink()
 

  With Options
        .UpdateFieldsAtPrint = False
        .UpdateLinksAtPrint = False
        .DefaultTray = "Use printer settings"
        .PrintBackground = True
        .PrintProperties = False
        .PrintFieldCodes = False
        .PrintComments = False
        .PrintHiddenText = False
        .PrintDrawingObjects = True
        .PrintDraft = False
        .PrintReverse = False
        .MapPaperSize = True
        .PrintOddPagesInAscendingOrder = False
        .PrintEvenPagesInAscendingOrder = False
    End With
    With ActiveDocument
        .PrintPostScriptOverText = False
        .PrintFormsData = False
    End With
    With ActiveDocument.Styles(wdStyleNormal).Font
        If .NameFarEast = .NameAscii Then
            .NameAscii = ""
        End If
        .NameFarEast = ""
    End With
    With ActiveDocument.PageSetup
        .LineNumbering.Active = False
        .Orientation = wdOrientPortrait
        .TopMargin = InchesToPoints(1)
        .BottomMargin = InchesToPoints(1)
        .LeftMargin = InchesToPoints(1.25)
        .RightMargin = InchesToPoints(1.25)
        .Gutter = InchesToPoints(0)
        .HeaderDistance = InchesToPoints(0.49)
        .FooterDistance = InchesToPoints(0.49)
        .PageWidth = InchesToPoints(8.5)
        .PageHeight = InchesToPoints(11)
        .FirstPageTray = 258
        .OtherPagesTray = 258
        .SectionStart = wdSectionNewPage
        .OddAndEvenPagesHeaderFooter = False
        .DifferentFirstPageHeaderFooter = False
        .VerticalAlignment = wdAlignVerticalTop
        .SuppressEndnotes = False
        .MirrorMargins = False
        .TwoPagesOnOne = False
        .BookFoldPrinting = False
        .BookFoldRevPrinting = False
        .BookFoldPrintingSheets = 1
        .GutterPos = wdGutterPosLeft
    End With
    With Options
        .UpdateFieldsAtPrint = False
        .UpdateLinksAtPrint = False
        .DefaultTray = "Use printer settings"
        .PrintBackground = True
        .PrintProperties = False
        .PrintFieldCodes = False
        .PrintComments = False
        .PrintHiddenText = False
        .PrintDrawingObjects = True
        .PrintDraft = False
        .PrintReverse = False
        .MapPaperSize = True
        .PrintOddPagesInAscendingOrder = False
        .PrintEvenPagesInAscendingOrder = False
    End With
    With ActiveDocument
        .PrintPostScriptOverText = False
        .PrintFormsData = False
    End With
    Application.PrintOut FileName:="", Range:=wdPrintAllDocument, Item:= _
        wdPrintDocumentContent, Copies:=1, Pages:="", PageType:=wdPrintAllPages, _
        ManualDuplexPrint:=False, Collate:=True, Background:=True, PrintToFile:= _
        False, PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _
        PrintZoomPaperHeight:=0
End Sub
Sub White()
 

    With Options
        .UpdateFieldsAtPrint = False
        .UpdateLinksAtPrint = False
        .DefaultTray = "Use printer settings"
        .PrintBackground = True
        .PrintProperties = False
        .PrintFieldCodes = False
        .PrintComments = False
        .PrintHiddenText = False
        .PrintDrawingObjects = True
        .PrintDraft = False
        .PrintReverse = False
        .MapPaperSize = True
        .PrintOddPagesInAscendingOrder = False
        .PrintEvenPagesInAscendingOrder = False
    End With
    With ActiveDocument
        .PrintPostScriptOverText = False
        .PrintFormsData = False
    End With
    With ActiveDocument.Styles(wdStyleNormal).Font
        If .NameFarEast = .NameAscii Then
            .NameAscii = ""
        End If
        .NameFarEast = ""
    End With
    With ActiveDocument.PageSetup
        .LineNumbering.Active = False
        .Orientation = wdOrientPortrait
        .TopMargin = InchesToPoints(1)
        .BottomMargin = InchesToPoints(1)
        .LeftMargin = InchesToPoints(1.25)
        .RightMargin = InchesToPoints(1.25)
        .Gutter = InchesToPoints(0)
        .HeaderDistance = InchesToPoints(0.49)
        .FooterDistance = InchesToPoints(0.49)
        .PageWidth = InchesToPoints(8.5)
        .PageHeight = InchesToPoints(11)
        .FirstPageTray = 260
        .OtherPagesTray = 260
        .SectionStart = wdSectionNewPage
        .OddAndEvenPagesHeaderFooter = False
        .DifferentFirstPageHeaderFooter = False
        .VerticalAlignment = wdAlignVerticalTop
        .SuppressEndnotes = False
        .MirrorMargins = False
        .TwoPagesOnOne = False
        .BookFoldPrinting = False
        .BookFoldRevPrinting = False
        .BookFoldPrintingSheets = 1
        .GutterPos = wdGutterPosLeft
    End With
    With Options
        .UpdateFieldsAtPrint = False
        .UpdateLinksAtPrint = False
        .DefaultTray = "Use printer settings"
        .PrintBackground = True
        .PrintProperties = False
        .PrintFieldCodes = False
        .PrintComments = False
        .PrintHiddenText = False
        .PrintDrawingObjects = True
        .PrintDraft = False
        .PrintReverse = False
        .MapPaperSize = True
        .PrintOddPagesInAscendingOrder = False
        .PrintEvenPagesInAscendingOrder = False
    End With
    With ActiveDocument
        .PrintPostScriptOverText = False
        .PrintFormsData = False
    End With
    Application.PrintOut FileName:="", Range:=wdPrintAllDocument, Item:= _
        wdPrintDocumentContent, Copies:=1, Pages:="", PageType:=wdPrintAllPages, _
        ManualDuplexPrint:=False, Collate:=True, Background:=True, PrintToFile:= _
        False, PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _
        PrintZoomPaperHeight:=0
       
End Sub
_________________________________________________

I'll test any reasonable response. Thanks.
Avatar of Joanne M. Orzech
Joanne M. Orzech
Flag of United States of America image

All you have to do to find out the tray codes is record a macro, go to File, Page Setup, select the trays you want, and then end the macro.

To view the macro, press Alt F11 - View, Project Manager, click on normal, click on new macros.

It will show you the tray names.


And the macro you posted can really be shortened up quite a bit.
Avatar of shantelechy

ASKER

Thanks much. I'm new at macros and just trying to pull a rabbit out of the hat for my colleagues. So I don't really care if the macro is bulky, just if it works.

As it is, it causes to print 2 white sheets, even though there is pink paper in tray 2 and using your 1/2 solution JOrzech, I was able to confirm that tray 2 is referenced as 258.... can anyone see anything in the macro that would cause it to NOT use tray 2 (pink) when tray 2 has been correctly referenced?

Thanks JOrzech and since that is 1/2 the answer I'll give you assisted... but I still need the macro to work :)
ASKER CERTIFIED SOLUTION
Avatar of Joanne M. Orzech
Joanne M. Orzech
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ok, turns out the Xerox Multifunction is hooped in some fashion. Testing shows the macro is as it should be
So it's a printer problem?  I don't understand what you mean "hooped".
Thanks for your help I'll probably accept your response.
Sorry, I keep posting not having noticed your reponses :)

It appears that the Xerox Multifunction is "expecting white 8.5 X 11 plain paper" paper in tray 2... but its configured to expect "pink 8.5 X 11 plain paper"

...so when I print using the macro and there is PINK in tray 2, the printer screen shows a 'fault' Tray 2 - White 8.5 X 11 plain paper expected - Please open the tray, make sure it's not empty (etc)

... but when I replace that pink paper with white... it prints my 2 copies, but both on white of course... so my printer is slightly handicapped when it comes to dealing with pink paper I guess :(
I've emailed Xerox for help
Very odd indeed!  At least your printer isn't colorblind :)

Thanks.