Advertisement

07.23.2008 at 07:19AM PDT, ID: 23588579
[x]
Attachment Details

How to choose the printer when printing by printer object by Visual Basic .net?

Asked by fsze88 in Microsoft Visual Basic.Net, Visual Studio 2008

Dear Sir/Madam

I have a question about choosing printer from Visual Basic .net
I am using following code to print a simply document that's fine. BUT, how to choose the difference printer to print document out? It is alway print out the document from default printer.
Is anyone willing to help me?
Thanks a lotStart Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
Dim result As System.Windows.Forms.DialogResult
        result = PrintDialog1.ShowDialog()
 
        If result.ToString.ToUpper.Equals("OK") Then
            Try
                Dim printer As New Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6.Printer
 
                printer.FontSize = 20
                printer.CurrentX = 100
                printer.CurrentY = 100
                printer.Print("ok")
                printer.EndDoc()
            Catch ex As Exception
                MsgBox(ex.Message)
            End Try
        End If
[+][-]07.23.2008 at 07:34AM PDT, ID: 22069709

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.23.2008 at 07:37AM PDT, ID: 22069759

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.23.2008 at 07:39AM PDT, ID: 22069778

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.23.2008 at 07:50AM PDT, ID: 22069904

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.23.2008 at 07:58AM PDT, ID: 22069991

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.23.2008 at 08:20AM PDT, ID: 22070223

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Visual Basic.Net, Visual Studio 2008
Sign Up Now!
Solution Provided By: VBRocks
Participating Experts: 3
Solution Grade: A
 
 
[+][-]07.23.2008 at 11:19PM PDT, ID: 22076459

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628