Question
Reply
 
Top Student
AccessMan
Posts: 3
Member Since: ‎03-21-2014
Message 1 of 5 (230 Views)
Accepted Solution

M603DN Printer Codes

Hello,

 

I have an M603DN printer that comes with 3 paper trays but I have added an additional 3.

 

I am trying to set the tray number programmatically via VBA in a Word document using the following code:

 

With ActiveDocument.PageSetup

 

.FirstPageTray = 260 (or 258, 259)
.OtherPagesTray = 260 (or 258, 259)

 

End With

 

Works well for the first 3 drawers but I need the codes for the 2nd 3 drawars. Anyone know them?

 

Thanks!

 

 

PhD Student
dansdaduk
Posts: 715
Member Since: ‎05-27-2010
Message 2 of 5 (205 Views)

Re: M603DN Printer Codes

No idea how relevant (or not) this is, but the hpmcpc25.gpd file (which appears to be associated with the "HP Universal Printing PCL 5" driver, and will be in the %Windows%\System32\Spool\Drivers\X64 folder if that driver is installed) includes the following 'definitions':

 

*Feature: InputBin
{
    *rcNameID: =IDS_PAPER_SOURCE            
    *%HelpIndex: =IDH_UNIDRV_FIRST_PAGE_SOURCE_IS
    *DefaultOption: Auto
    *ConflictPriority: 3
    *FeatureType: DOC_PROPERTY

    *Option: Auto
    {
        *rcNameID: =IDS_PRINTER_AUTO_SELECT

        *Command: CmdSelect
        {
            *Order: DOC_SETUP.40
            *Cmd: "<1B>&l7H"
        }
    }
    *Option: ManualFeed
    {
        *rcNameID: =IDS_MANUAL_FEED_IN_TRAY1
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.40
            *Cmd: "<1B>&l2H"
        }
    }
    *Option: Tray1
    {
        *rcNameID: =IDS_TRAY1
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.40
            *Cmd: "<1B>&l4H"
        }
    }
    *Option: Tray2
    {
        *rcNameID: =IDS_TRAY2
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.40
            *Cmd: "<1B>&l1H"
        }
    }
    *Option: Tray3
    {
        *rcNameID: =IDS_TRAY3
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.40
            *Cmd: "<1B>&l5H"
        }
    }

    *Option: Tray4
    {
        *rcNameID: =IDS_TRAY4
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.40
            *Cmd: "<1B>&l8H"
        }
    }

    *Option: Tray5
    {
        *rcNameID: =IDS_TRAY5
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.40
            *Cmd: "<1B>&l9H"
        }
    }
    
    *Option: Tray6
    {
        *rcNameID: =IDS_TRAY_6
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.40
            *Cmd: "<1B>&l10H"
        }
    }
    *Option: Tray7
    {
        *rcNameID: =IDS_TRAY7
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.40
            *Cmd: "<1B>&l11H"
        }
    }
    
    *Option: Tray8
    {
        *rcNameID: =IDS_TRAY8
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.40
            *Cmd: "<1B>&l12H"
        }
    }
    
    *Option: Tray9
    {
        *rcNameID: =IDS_TRAY9
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.40
            *Cmd: "<1B>&l13H"
        }
    }

    *Option: TrayExt1
    {
        *Name: "Ex Tray1"
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.40
            *Cmd: "<1B>&l20H"
        }
    }
    *Option: TrayExt2
    {
        *Name: "Ex Tray2"
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.40
            *Cmd: "<1B>&l21H"
        }
    }
    *Option: TrayExt3
    {
        *Name: "Ex Tray3"
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.40
            *Cmd: "<1B>&l22H"
        }
    }

    *Option: TrayExt4
    {
        *Name: "Ex Tray4"
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.40
            *Cmd: "<1B>&l23H"
        }
    }

    *Option: TrayExt5
    {
        *Name: "Ex Tray5"
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.40
            *Cmd: "<1B>&l24H"
        }
    }
    
    *Option: EnvFeed
    {
        *rcNameID: =IDS_ENVELOPE_FEEDER_DISPLAY
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.40
            *Cmd: "<1B>&l6H"
        }
    }
    
}

 

 

Top Student
AccessMan
Posts: 3
Member Since: ‎03-21-2014
Message 3 of 5 (189 Views)

Re: M603DN Printer Codes

Hi Dansdaduk,

 

Thanks for your input. I cannot find that driver on my PC but additionally, the method I'm using to select the tray in VBA only accepts numbers.

 

Thank you again.

 

Best,

 

Scott

PhD Student
dansdaduk
Posts: 715
Member Since: ‎05-27-2010
Message 4 of 5 (187 Views)

Re: M603DN Printer Codes

>> ... the method I'm using to select the tray in VBA only accepts numbers ...

 

Numbers (digits) are the variable ("#") values associated with the <Esc>&l#H "Paper Source" PCL escape sequence , where <Esc> represents the Escape control-code character (the character with decimal code 27, or hexadecimal 1B)

 

The definitions referred to in my previous post associate names with such values; for example:

 

For IDS_TRAY1, the command is shown as <1B>&l4H, so the value is 4.

For IDS_TRAY2, the command is shown as <1B>&l1H, so the value is 1.

For IDS_TRAY3, the command is shown as <1B>&l5H, so the value is 5.

For IDS_TRAY4, the command is shown as <1B>&l8H, so the value is 8.

etc., etc.

Top Student
AccessMan
Posts: 3
Member Since: ‎03-21-2014
Message 5 of 5 (180 Views)

Re: M603DN Printer Codes

Thanks agains. I think I solved it and don't know why I didn't think of it sooner.

 

I just went into Word and recorded a macro whereupon I went to 'Print', 'Page Setup', 'Paper', then selected the trays. It generated the macro and contained therein was the three digit (257, 260, 261) codes I needed.

 

Thanks for your suggestions!

 

 

† The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation