?
Solved

Printer Dialog and Default Printer

Posted on 2003-02-20
2
Medium Priority
?
259 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
[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
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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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 Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

770 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