?
Solved

Print Queue Exception - How Do I Catch It?

Posted on 2009-07-01
5
Medium Priority
?
958 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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

752 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