?
Solved

Printer Dialog and Default Printer

Posted on 2003-02-20
2
Medium Priority
?
264 Views
Last Modified: 2010-05-01
I need to know how to show a Printer Dialog and after select a printer, print something without changing the default system printer.

Any Ideas?
Thanks
0
Comment
Question by:deCorvett
2 Comments
 

Accepted Solution

by:
lz73 earned 200 total points
ID: 7990769
That depends on what do you want to print. Assume you only want to print from VB.
To show a printer dialog and select printer, please refer to this document: http://support.microsoft.com/default.aspx?scid=kb;en-us;322710

And after user select a printer from the dialog, you can set printer and print like this:

If Printer.DeviceName <> UserSelectedPrinterName Then
    For Each objPrinter In Printers
       If UCase$(objPrinter.DeviceName) = NewPrinterName Then
            Set Printer = objPrinter
       End If
    Next
End If
Printer.Copies = printDlg.Copies
Printer.Orientation = printDlg.Orientation
Printer.ColorMode = printDlg.ColorMode
Printer.Duplex = printDlg.Duplex
Printer.PaperBin = printDlg.PaperBin
Printer.PaperSize = printDlg.PaperSize
Printer.PrintQuality = printDlg.PrintQuality
Printer.Print
Printer.EndDoc

In VB, initially the Printer is the system default printer, but you change the Printer object in VB will not change the system default printer.

lz73
0
 

Author Comment

by:deCorvett
ID: 7998370
thank you very much!!!!
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month9 days, 23 hours left to enroll

569 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