Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Print Queue Exception - How Do I Catch It?

Posted on 2009-07-01
5
Medium Priority
?
969 Views
Last Modified: 2013-11-07
Should see like a relatively obvious one, but I'm unable to actually state that I want to catch this particular type of exception.  Debugging shows that it is of type PrintQueueException, but it never appears in intellisense.  Googling has shown a couple of similar problems but hasn't given me an indication of a solution, and due to standards I can't just catch type Exception.

Does anybody know how I can handle this issue?
0
Comment
Question by:angus_young_acdc
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 9

Expert Comment

by:Rahul Goel ITIL
ID: 24752523

I hope this could help you
System.Management.ObjectQuery oq = new System.Management.ObjectQuery
"SELECT * FROM Win32_PrintJob");
ManagementObjectSearcher query1 = new ManagementObjectSearcher(oq);
ManagementObjectCollection queryCollection1 = query1.Get();
foreach( ManagementObject mo in queryCollection1 )
{
Console.WriteLine("Printer Driver : " + mo["DriverName"].ToString());
Console.WriteLine("Document Name : " + mo["Document"].ToString());
Console.WriteLine("Document Owner : " + mo["Owner"].ToString());
Console.WriteLine("==================================");
}

Open in new window

0
 
LVL 15

Author Comment

by:angus_young_acdc
ID: 24752803
Hi mate,

Thanks for the code but I'm already returning the printer information that I need, I just need to know how to catch the PrintQueueException as it's unavailable in intellisense.
0
 
LVL 9

Assisted Solution

by:Rahul Goel ITIL
Rahul Goel ITIL earned 80 total points
ID: 24755663
you can not trap the exception using PrintQueueException class, you can get this class under System.Printing

refer to the following link:
http://msdn.microsoft.com/en-us/library/system.printing.printqueueexception.aspx
0
 
LVL 15

Author Comment

by:angus_young_acdc
ID: 24780364
And how do I do that?
0
 
LVL 15

Accepted Solution

by:
angus_young_acdc earned 0 total points
ID: 24794516
Anybody able to help solve this?
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question