Results 1 to 6 of 6
  1. #1
    Star Lounger
    Join Date
    Mar 2001
    Location
    New York, USA
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Printer turned on? (XL2000)

    I asked this long ago and I have still not found a way to check if the printer is on. I developed code for point of sale. I can use messages but some of the sales people don't pay attention. As the code progresses it will print, save the export information and clear the current sales receipt. Problem is if the printer isn't turned on the customer doesn't get a receipt.

    I have looked in MSKB, and some API sites but have not found anything to check if the printer is on.

  2. #2
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Vienna, Wien, Austria
    Posts
    5,009
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Printer turned on? (XL2000)

    <pre></pre>

    IF it's a network printer, you could try pinging it with an API call. Haven't looked at this much but hope this helps.
    Gre

  3. #3
    2 Star Lounger
    Join Date
    Mar 2002
    Location
    Western NY, USA
    Posts
    157
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Printer turned on? (XL2000)

    I have worked with printers in Access but not Excel, therefore I will point you to an Access resource.

    MS Access 95 Developers Handbook (Sybex), Ch 10 - which I believe (it has been a couple of years, so my memory may be incorrect) was a free chapter on the MS Site. It may have been in the TechNet CD's, to which we subscribe.

    When I put this together in 1998, I was writting to several of the devices properties and therefore delcared several UDTs, as defined in the book. I would think that if all you want to do is check to see if the printer is on, you could use apiOpenPrinter to check the status. You will need one UDT for this.

    Type tagPrinterDefaults
    pDatatype As String
    pDevMode As Long
    DesiredAccess As Long
    End Type

    The OpenPrinter may only interface with the MS Windows instance of the printer, not the physical printer. In this case, you would have to try writting something to the printer and then check for an error.

    Sorry I cannot give you specifics since so much time has lapsed, but perhaps I have pointed you in the right direction. One thing I found for sure is that working with printers is not easy.

    If you set the printer properties to print directly to the printer, as opposed to spooling, will you get an immediate error message back to your POS system?

  4. #4
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Kortrijk, Belgium
    Posts
    571
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Printer turned on? (XL2000)

    I am not sure about this, but if you use Excel's VBA property

    Application.ActivePrinter

    this returns a string containing the name of the active printer with the connected port

    e.g. HP Deskjet 930C on LPT1:

    Use Instr to find 'on'. If no printer is connected, Instr will return 0. Of course, this is language dependent.

  5. #5
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Kortrijk, Belgium
    Posts
    571
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Printer turned on? (XL2000)

    And of course, you can use API calls. Here is half of the solution to your problem: click here .

  6. #6
    Star Lounger
    Join Date
    Mar 2001
    Location
    New York, USA
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Printer turned on? (XL2000)

    It is a local printer, no network.

    Thanks for the suggestions, I will play with some of the code and see if I can identify the printer status.

    Will let you know if anything works.

Posting Permissions

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