ManagementObjectSearcher("Select * from Win32_Printer")

G

Guest

Hello all...

My application uses custom reports from Microsoft's report viewer and not
Crystal Reports. My understanding is there is no way to make the printdialog
select a different printer than the default via code, right?

So - here's what I have my app doing to fix the issue - There's a form the
user can load that performs the
ManagementObjectSearcher("Select * from Win32_Printer")
command. It will load all the printers on the computer into a drop-down
box. The user can then select the printer for each different report and
click save on the form to write the selections to the config.

When the user then runs that report, the computer performs the
ManagementObjectSearcher("Select * from Win32_Printer")
command again to determine the default printer on the computer, stores THAT
printer into memory, pulls the correct printer selection from the config file
and sets that one as the default printer. After the report is either printed
or cancelled, it returns the default printer back to the original selection.

MY QUESTION IS: If a network computer is off, the printer is offline.
Everytime I run the command to search for the computers printers, it takes
awhile. Is there a way to avoid waiting for the printer to repsond as
offline??

Thank you and sorry for the long story!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top