+ Reply to Thread
Results 1 to 4 of 4

How to send HP printer escape codes from Excel?

  1. #1
    MRBILLK
    Guest

    How to send HP printer escape codes from Excel?

    Trying to select tray 2 on an HP 1200N ink jet printer from a VBA so each
    page prints using the correct tray. I know the <esc> codes to send I just
    don't know how to send them.

  2. #2
    Registered User Ivan F Moala's Avatar
    Join Date
    10-25-2003
    Location
    Auckland, New Zealand
    Posts
    71
    I think something along the lines of

    Please Login or Register  to view this content.
    Kind Regards,
    Ivan F Moala From the City of Sails
    \1

  3. #3
    MRBILLK
    Guest

    Re: How to send HP printer escape codes from Excel?

    Ivan,
    I am trying to use your code but I also am using a networked printer
    identified as shown below and on PORT USB003. I tried using "USB003" for
    "LPT1". It does not generate an error but nothing happens.

    Application.ActivePrinter = "HP Business Inkjet 1200 Series on Ne02:"

    Any other ideas

    Thanks

    "Ivan F Moala" wrote:

    >
    > I think something along the lines of
    >
    >
    > Code:
    > --------------------
    >
    > Sub PrintLine()
    > Dim hdlTxt As Long
    >
    > hdlTxt = FreeFile
    > '// Open the LPT1 port or Name of printer
    > Open "LPT1" For Output As #hdlTxt
    >
    > '// Print command OR TEXT
    > Print #1, "THIS IS A TEST"
    >
    > '// Close LPT1 port
    > Close #hdlTxt
    >
    > End Sub
    >
    > --------------------
    >
    >
    > --
    > Ivan F Moala
    >
    >
    > ------------------------------------------------------------------------
    > Ivan F Moala's Profile: http://www.excelforum.com/member.php...fo&userid=1954
    > View this thread: http://www.excelforum.com/showthread...hreadid=556735
    >
    >


  4. #4
    MRBILLK
    Guest

    Re: How to send HP printer escape codes from Excel?

    Ivan,
    I am trying to use your code but I also am using a networked printer
    identified as shown below and on PORT USB003. I tried using "USB003" for
    "LPT1". It does not generate an error but nothing happens.

    Application.ActivePrinter = "HP Business Inkjet 1200 Series on Ne02:"

    Any other ideas

    Thanks


    "Ivan F Moala" wrote:

    >
    > I think something along the lines of
    >
    >
    > Code:
    > --------------------
    >
    > Sub PrintLine()
    > Dim hdlTxt As Long
    >
    > hdlTxt = FreeFile
    > '// Open the LPT1 port or Name of printer
    > Open "LPT1" For Output As #hdlTxt
    >
    > '// Print command OR TEXT
    > Print #1, "THIS IS A TEST"
    >
    > '// Close LPT1 port
    > Close #hdlTxt
    >
    > End Sub
    >
    > --------------------
    >
    >
    > --
    > Ivan F Moala
    >
    >
    > ------------------------------------------------------------------------
    > Ivan F Moala's Profile: http://www.excelforum.com/member.php...fo&userid=1954
    > View this thread: http://www.excelforum.com/showthread...hreadid=556735
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1