Results 1 to 2 of 2

Thread: [RESOLVED] Select the printer from the PrintPreviewDialog

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2010
    Posts
    350

    Resolved [RESOLVED] Select the printer from the PrintPreviewDialog

    When I print a document the user first has to select the printer, I have used the code shown.

    <code>
    If PrintDialog1.ShowDialog = DialogResult.OK Then
    PrintDocument1.PrinterSettings = PrintDialog1.PrinterSettings
    PrintDocument1.DefaultPageSettings.Landscape = True
    Call PrintDocument1.Print()
    End If
    </code>


    To do the PrintPreview I use the folowing code:
    <code>
    PrintDocument1.DefaultPageSettings.Landscape = True
    PrintPreviewDialog1.WindowState = FormWindowState.Normal
    PrintPreviewDialog1.StartPosition = FormStartPosition.CenterScreen
    PrintPreviewDialog1.ClientSize = New Size(800, 600)
    PrintPreviewDialog1.ShowIcon = False
    PrintPreviewDialog1.Document = PrintDocument1
    PrintPreviewDialog1.ShowDialog()
    </code>

    If the user descides to print from the print preview, the document is printed to the default printer, the user cannot select the printer.

    How do I modify my code so the user can select the printer from PrintPreview?

    In Windows Explorer the from the Print Preview the user has to slect the printer and in MicrosoftWord there in the PrintPreview there is option to select the printer.

  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2010
    Posts
    350

    Re: Select the printer from the PrintPreviewDialog

    I found a good solution - it's at the bottom of this post.
    It's all a matter of know what to look for.

    http://social.msdn.microsoft.com/For...lect-a-printer

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width