[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 543
  • Last Modified:

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.
0
shantelechy
Asked:
shantelechy
  • 5
  • 4
1 Solution
 
Joanne M. OrzechManager, Document Services CenterCommented:
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.
0
 
shantelechyAuthor Commented:
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 :)
0
 
Joanne M. OrzechManager, Document Services CenterCommented:
See if this works:

Public Sub Shantel()
  With Options
        .UpdateFieldsAtPrint = False
        .UpdateLinksAtPrint = False
        .DefaultTray = "Use printer settings"
        .PrintBackground = True
    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
        .FirstPageTray = 258
        .OtherPagesTray = 258
    End With
    With Options
        .DefaultTray = "Use printer settings"
    End With
    With ActiveDocument
        .PrintPostScriptOverText = False
        .PrintFormsData = False
    End With
    ActiveDocument.PrintOut
    MsgBox ("Pink printed out")
    With ActiveDocument.PageSetup
        .FirstPageTray = 260
        .OtherPagesTray = 260
    End With
    ActiveDocument.PrintOut
    MsgBox ("White printed out")
End Sub
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
shantelechyAuthor Commented:
ok, turns out the Xerox Multifunction is hooped in some fashion. Testing shows the macro is as it should be
0
 
Joanne M. OrzechManager, Document Services CenterCommented:
So it's a printer problem?  I don't understand what you mean "hooped".
0
 
shantelechyAuthor Commented:
Thanks for your help I'll probably accept your response.
0
 
shantelechyAuthor Commented:
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 :(
0
 
shantelechyAuthor Commented:
I've emailed Xerox for help
0
 
Joanne M. OrzechManager, Document Services CenterCommented:
Very odd indeed!  At least your printer isn't colorblind :)

Thanks.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now