Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing from VB via API

Status
Not open for further replies.

splaisance

Programmer
Jul 2, 2001
67
US
I do not have any experience with API's and have been trying to understand them with some luck. Unfortunately I am still stuck on how to pull the information together to correct my problem.

I have a VB program which prints a report using the visual basic printer object. The problem is that if I allow the users to choose a printer to print to via the common dialog box, it changes their default printer. If I don't allow them to change the printer - then the report, of course, printers on their default printer.


I want to allow the user to choose which network printer they want the report to print on BUT their default printer needs to either stay the same or be changed back. Can someone help me? I think I need to use a device context to return a handle to the printer but can't figure out exactly how to do this.


Many Thanks!!

Shannon
 
gfritz,

Have you tested using the common dialog box with setting the printer default to false? I have. If the user selects a printer that is not the default printer, then the common dialog box will not send the printout to the printer at all (when the printerdefault property is set to false).

I had to find another work around by transversing the printer collection.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top