Default printer program

I am looking for sample VB program: to set up default printer for printouts. Please, help.
iriskaAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
jjbyersConnect With a Mentor Commented:
use the commondialog control to set the printer properties.

This is straight out of VB5 help

Private Sub Command1_Click()
    Dim BeginPage, EndPage, NumCopies, i
    ' Set Cancel to True
    CommonDialog1.CancelError = True
    On Error GoTo ErrHandler
    ' Display the Print dialog box
    CommonDialog1.ShowPrinter
    ' Get user-selected values from the dialog box
    BeginPage = CommonDialog1.FromPage
    EndPage = CommonDialog1.ToPage
    NumCopies = CommonDialog1.Copies
    For i = 1 To NumCopies
        ' Put code here to send data to the printer

    Next i
    Exit Sub
ErrHandler:
    ' User pressed the Cancel button
    Exit Sub
End Sub

Hope this helps.
0
All Courses

From novice to tech pro — start learning today.