Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Unable to catch print exceptions

Unable to catch print exceptions

Scheduled Pinned Locked Moved Visual Basic
csharpc++sysadminhelp
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sri_0099
    wrote on last edited by
    #1

    Hello All, I am new to .NET. Can any body please tell me how to catch all possible error that PrintDocument.Print() method returns!!! I have installed a dummy printer on my machine..and tried to give print using PrintDocument.Print() method, but it is not giving any error. When i tried with an older application(which is written in C,C++)..it is throwing an error saying Network printer error. How can i catch same error using VB.NET 2005. Thanks in advance. Regards, Sr

    A 1 Reply Last reply
    0
    • S sri_0099

      Hello All, I am new to .NET. Can any body please tell me how to catch all possible error that PrintDocument.Print() method returns!!! I have installed a dummy printer on my machine..and tried to give print using PrintDocument.Print() method, but it is not giving any error. When i tried with an older application(which is written in C,C++)..it is throwing an error saying Network printer error. How can i catch same error using VB.NET 2005. Thanks in advance. Regards, Sr

      A Offline
      A Offline
      Ashfield
      wrote on last edited by
      #2

      Just put a try/catch round your code, that will capture all exceptions.

      Bob Ashfield Consultants Ltd Proud to be a 2009 Code Project MVP

      S 1 Reply Last reply
      0
      • A Ashfield

        Just put a try/catch round your code, that will capture all exceptions.

        Bob Ashfield Consultants Ltd Proud to be a 2009 Code Project MVP

        S Offline
        S Offline
        sri_0099
        wrote on last edited by
        #3

        Bob, No luck with Try/Catch. With PrintDoc.Print() it is adding document in queue. where as my old system not adding doc to printer and is shoing error like network error. Really i want solution for this..if printer does not return any vaklue then my code goes wrong.Please assist me. Regards, Sr

        A 1 Reply Last reply
        0
        • S sri_0099

          Bob, No luck with Try/Catch. With PrintDoc.Print() it is adding document in queue. where as my old system not adding doc to printer and is shoing error like network error. Really i want solution for this..if printer does not return any vaklue then my code goes wrong.Please assist me. Regards, Sr

          A Offline
          A Offline
          Ashfield
          wrote on last edited by
          #4

          sri_0099 wrote:

          With PrintDoc.Print() it is adding document in queue

          And is the document correct? If so, maybe you need to be checking the printer status or something? Its years since I used printdoc, so I can't remember all the commands, but there should be something to check the printer status I would expect.

          Bob Ashfield Consultants Ltd Proud to be a 2009 Code Project MVP

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups